@Test public void combineTest() { AnswerSummary summary = new AnswerSummary("notes1", 1, 2, 3); AnswerSummary summaryOther = new AnswerSummary("notes2", 4, 5, 6); summary.combine(summaryOther); assertThat(summary.getNotes(), equalTo("notes1; notes2")); assertThat(summary.getNumFailed(), equalTo(5)); assertThat(summary.getNumPassed(), equalTo(7)); assertThat(summary.getNumResults(), equalTo(9)); }
public void combine(AnswerSummary other) { if (other != null) { _notes = (Strings.isNullOrEmpty(_notes)) ? other.getNotes() : _notes + "; " + other.getNotes(); _numFailed += other.getNumFailed(); _numPassed += other.getNumPassed(); _numResults += other.getNumResults(); } }
AnswerSummary { public void combine(AnswerSummary other) { if (other != null) { _notes = (Strings.isNullOrEmpty(_notes)) ? other.getNotes() : _notes + "; " + other.getNotes(); _numFailed += other.getNumFailed(); _numPassed += other.getNumPassed(); _numResults += other.getNumResults(); } } }
AnswerSummary { public void combine(AnswerSummary other) { if (other != null) { _notes = (Strings.isNullOrEmpty(_notes)) ? other.getNotes() : _notes + "; " + other.getNotes(); _numFailed += other.getNumFailed(); _numPassed += other.getNumPassed(); _numResults += other.getNumResults(); } } @JsonCreator  AnswerSummary();  AnswerSummary(String notes, int numFailed, int numPassed, int numResults); }
AnswerSummary { public void combine(AnswerSummary other) { if (other != null) { _notes = (Strings.isNullOrEmpty(_notes)) ? other.getNotes() : _notes + "; " + other.getNotes(); _numFailed += other.getNumFailed(); _numPassed += other.getNumPassed(); _numResults += other.getNumResults(); } } @JsonCreator  AnswerSummary();  AnswerSummary(String notes, int numFailed, int numPassed, int numResults); void combine(AnswerSummary other); @JsonProperty(PROP_NOTES) String getNotes(); @JsonProperty(PROP_NUM_FAILED) int getNumFailed(); @JsonProperty(PROP_NUM_PASSED) int getNumPassed(); @JsonProperty(PROP_NUM_RESULTS) int getNumResults(); void reset(); @JsonProperty(PROP_NOTES) void setNotes(String notes); @JsonProperty(PROP_NUM_FAILED) void setNumFailed(int numFailed); @JsonProperty(PROP_NUM_PASSED) void setNumPassed(int numPassed); @JsonProperty(PROP_NUM_RESULTS) void setNumResults(int numResults); }
AnswerSummary { public void combine(AnswerSummary other) { if (other != null) { _notes = (Strings.isNullOrEmpty(_notes)) ? other.getNotes() : _notes + "; " + other.getNotes(); _numFailed += other.getNumFailed(); _numPassed += other.getNumPassed(); _numResults += other.getNumResults(); } } @JsonCreator  AnswerSummary();  AnswerSummary(String notes, int numFailed, int numPassed, int numResults); void combine(AnswerSummary other); @JsonProperty(PROP_NOTES) String getNotes(); @JsonProperty(PROP_NUM_FAILED) int getNumFailed(); @JsonProperty(PROP_NUM_PASSED) int getNumPassed(); @JsonProperty(PROP_NUM_RESULTS) int getNumResults(); void reset(); @JsonProperty(PROP_NOTES) void setNotes(String notes); @JsonProperty(PROP_NUM_FAILED) void setNumFailed(int numFailed); @JsonProperty(PROP_NUM_PASSED) void setNumPassed(int numPassed); @JsonProperty(PROP_NUM_RESULTS) void setNumResults(int numResults);  }