Skip to content

Instantly share code, notes, and snippets.

@tadams
Created August 15, 2014 21:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tadams/f119db98e85c73f2a722 to your computer and use it in GitHub Desktop.
Save tadams/f119db98e85c73f2a722 to your computer and use it in GitHub Desktop.
public interface Compares<T> extends Comparable<T> {
default boolean isLessThan(T other) {
return compareTo(other) < 0;
}
default boolean isGreaterThan(T other) {
return compareTo(other) > 0;
}
default boolean isEqual(T other) {
return compareTo(other) == 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment