TypeInferenceProgramState implements ProgramState { void setTypes(Symbol symbol, Set<InferredType> types) { inferredTypesBySymbol.put(symbol, types); } TypeInferenceProgramState(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); @Override ProgramState join(ProgramState otherState); @Override ProgramState copy();  }
@Test public void test_equals() { TypeInferenceProgramState typeInferenceProgramState = new TypeInferenceProgramState(); assertThat(typeInferenceProgramState) .isEqualTo(typeInferenceProgramState) .isEqualTo(new TypeInferenceProgramState()) .isNotEqualTo(otherProgramState) .isNotEqualTo(null); typeInferenceProgramState.setTypes(a, Collections.singleton(InferredTypes.INT)); typeInferenceProgramState.setTypes(b, new HashSet<>(Arrays.asList(InferredTypes.BOOL, InferredTypes.STR))); TypeInferenceProgramState other = new TypeInferenceProgramState(); other.setTypes(a, Collections.singleton(InferredTypes.INT)); other.setTypes(b, new HashSet<>(Arrays.asList(InferredTypes.BOOL, InferredTypes.STR))); assertThat(typeInferenceProgramState).isEqualTo(other); other = new TypeInferenceProgramState(); other.setTypes(a, Collections.singleton(InferredTypes.INT)); other.setTypes(b, new HashSet<>(Arrays.asList(InferredTypes.INT, InferredTypes.STR))); assertThat(typeInferenceProgramState).isNotEqualTo(other); }