package enumeration; public enum CompareType { MORE_THAN_EQ { @Override public > boolean compare(T value, T threshold) { return value.compareTo(threshold) >= 0; } }, LESS_THAN_EQ { @Override public > boolean compare(T value, T threshold) { return value.compareTo(threshold) <= 0; } }; public abstract > boolean compare(T value, T threshold); }