@Test public void testEquals() { Analysis a = new Analysis("foo", Maps.newHashMap()); Analysis aCopy = new Analysis("foo", Maps.newHashMap()); Analysis aWithQuestion = new Analysis("foo", Collections.singletonMap("question", "questionContent")); Analysis aOtherName = new Analysis("bar", Maps.newHashMap()); new EqualsTester() .addEqualityGroup(a, aCopy) .addEqualityGroup(aWithQuestion) .addEqualityGroup(aOtherName) .testEquals(); }
@Override public boolean equals(Object o) { if (!(o instanceof Analysis)) { return false; } Analysis other = (Analysis) o; return Objects.equals(_name, other._name) && Objects.equals(_questions, other._questions); }
Analysis { @Override public boolean equals(Object o) { if (!(o instanceof Analysis)) { return false; } Analysis other = (Analysis) o; return Objects.equals(_name, other._name) && Objects.equals(_questions, other._questions); } }
Analysis { @Override public boolean equals(Object o) { if (!(o instanceof Analysis)) { return false; } Analysis other = (Analysis) o; return Objects.equals(_name, other._name) && Objects.equals(_questions, other._questions); } @JsonCreator  Analysis(
      @JsonProperty(PROP_NAME) String name,
      @JsonProperty(PROP_QUESTIONS) @Nullable Map<String, String> questions); }
Analysis { @Override public boolean equals(Object o) { if (!(o instanceof Analysis)) { return false; } Analysis other = (Analysis) o; return Objects.equals(_name, other._name) && Objects.equals(_questions, other._questions); } @JsonCreator  Analysis(
      @JsonProperty(PROP_NAME) String name,
      @JsonProperty(PROP_QUESTIONS) @Nullable Map<String, String> questions); @JsonProperty(PROP_NAME) String getName(); @JsonProperty(PROP_QUESTIONS) Map<String, String> getQuestions(); void addQuestion(String questionName, String questionContent); void deleteQuestion(String questionName); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); }
Analysis { @Override public boolean equals(Object o) { if (!(o instanceof Analysis)) { return false; } Analysis other = (Analysis) o; return Objects.equals(_name, other._name) && Objects.equals(_questions, other._questions); } @JsonCreator  Analysis(
      @JsonProperty(PROP_NAME) String name,
      @JsonProperty(PROP_QUESTIONS) @Nullable Map<String, String> questions); @JsonProperty(PROP_NAME) String getName(); @JsonProperty(PROP_QUESTIONS) Map<String, String> getQuestions(); void addQuestion(String questionName, String questionContent); void deleteQuestion(String questionName); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }