RelationalSymbolicValue extends BinarySymbolicValue { public boolean isEquality() { return kind == Kind.EQUAL || kind == Kind.METHOD_EQUALS; } RelationalSymbolicValue(Kind kind); @VisibleForTesting  RelationalSymbolicValue(Kind kind, SymbolicValue leftOp, SymbolicValue rightOp); @Override List<ProgramState> setConstraint(ProgramState initialProgramState, BooleanConstraint booleanConstraint); @Override boolean equals(Object o); boolean isEquality(); @Override int hashCode(); @Override String toString(); @VisibleForTesting Kind kind();  }
@Test void test_equality() throws Exception { RelationalSymbolicValue equalRSV = relationalSV(Tree.Kind.EQUAL_TO, a, b); assertThat(equalRSV.isEquality()).isTrue(); RelationalSymbolicValue methodEqualsRSV = new RelationalSymbolicValue(RelationalSymbolicValue.Kind.METHOD_EQUALS, a, b); assertThat(methodEqualsRSV.isEquality()).isTrue(); Stream.of(Tree.Kind.NOT_EQUAL_TO, Tree.Kind.LESS_THAN, Tree.Kind.LESS_THAN_OR_EQUAL_TO, Tree.Kind.GREATER_THAN, Tree.Kind.GREATER_THAN_OR_EQUAL_TO) .map(k -> relationalSV(k, a, b)) .forEach(sv -> assertThat(sv.isEquality()).isFalse()); }