Constraint { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Constraint that = (Constraint) o; return bitSet == that.bitSet; } private  Constraint(ValueSubSet subSet); private  Constraint(int bitSet); Constraint and(Constraint other); Constraint or(Constraint other); Constraint not(); Type type(); Optional<Range<Integer>> numericRange(); boolean isSingleValue(); Set<Type> typeSet(); boolean isStricterOrEqualTo(Constraint other); boolean isIncompatibleWith(Constraint other); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static final Constraint ANY_VALUE; static final Constraint NO_POSSIBLE_VALUE; static final Constraint NULL; static final Constraint UNDEFINED; static final Constraint ZERO; static final Constraint EMPTY_STRING_PRIMITIVE; static final Constraint NAN; static final Constraint FALSE; static final Constraint TRUE; static final Constraint FUNCTION; static final Constraint POSITIVE_NUMBER_PRIMITIVE; static final Constraint NEGATIVE_NUMBER_PRIMITIVE; static final Constraint TRUTHY_STRING_PRIMITIVE; static final Constraint ARRAY; static final Constraint DATE; static final Constraint REGEXP; static final Constraint STRING_OBJECT; static final Constraint NUMBER_OBJECT; static final Constraint BOOLEAN_OBJECT; static final Constraint OTHER_OBJECT; static final Constraint NULL_OR_UNDEFINED; static final Constraint TRUTHY_NUMBER_PRIMITIVE; static final Constraint KNOWN_OBJECTS; static final Constraint NOT_NULLY; static final Constraint TRUTHY; static final Constraint FALSY; static final Constraint NUMBER_PRIMITIVE; static final Constraint ANY_NUMBER; static final Constraint STRING_PRIMITIVE; static final Constraint ANY_STRING; static final Constraint BOOLEAN_PRIMITIVE; static final Constraint ANY_BOOLEAN; static final Constraint OBJECT; }
@Test public void equals() throws Exception { assertThat(Constraint.NULL).isEqualTo(Constraint.NULL); assertThat(Constraint.NULL).isNotEqualTo(Constraint.UNDEFINED); assertThat(Constraint.NULL).isNotEqualTo(""); }