Example for a class implementing comparable interface in Java