@Test(expected = IllegalArgumentException.class) public void combineNullTest() { LookupResultItem item = new LookupResultItem("p1", "proj1", 2); item.combine(null); }
void combine(final LookupResultItem other) { if (other == null || !canBeCombinedWith(other)) { throw new IllegalArgumentException("Cannot combine with " + other); } projects.addAll(other.projects); score += other.score; }
LookupResultItem implements Comparable<LookupResultItem> { void combine(final LookupResultItem other) { if (other == null || !canBeCombinedWith(other)) { throw new IllegalArgumentException("Cannot combine with " + other); } projects.addAll(other.projects); score += other.score; } }
LookupResultItem implements Comparable<LookupResultItem> { void combine(final LookupResultItem other) { if (other == null || !canBeCombinedWith(other)) { throw new IllegalArgumentException("Cannot combine with " + other); } projects.addAll(other.projects); score += other.score; } LookupResultItem(final String phrase, final String project, final long score); }
LookupResultItem implements Comparable<LookupResultItem> { void combine(final LookupResultItem other) { if (other == null || !canBeCombinedWith(other)) { throw new IllegalArgumentException("Cannot combine with " + other); } projects.addAll(other.projects); score += other.score; } LookupResultItem(final String phrase, final String project, final long score); String getPhrase(); Set<String> getProjects(); long getScore(); @Override int compareTo(final LookupResultItem other); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
LookupResultItem implements Comparable<LookupResultItem> { void combine(final LookupResultItem other) { if (other == null || !canBeCombinedWith(other)) { throw new IllegalArgumentException("Cannot combine with " + other); } projects.addAll(other.projects); score += other.score; } LookupResultItem(final String phrase, final String project, final long score); String getPhrase(); Set<String> getProjects(); long getScore(); @Override int compareTo(final LookupResultItem other); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }