boolean (@NotNull T object, boolean includingEndpoints) { if (includingEndpoints) { return object.compareTo(myFrom) >= 0 && object.compareTo(myTo) <= 0; } return object.compareTo(myFrom) > 0 && object.compareTo(myTo) < 0; }