MutableWordUse { public void accumulate(final AnalysisRecord record) { if (wordIdentifier == null) { wordIdentifier = record.getIdentifier(); } else { wordIdentifier = PreferredFormTool.preferredForm(wordIdentifier, record.getIdentifier()); } lineNos.add(record.getLine()); }  void accumulate(final AnalysisRecord record); MutableWordUse combine(final MutableWordUse that); WordUse toWordUse();  }
@Test public void testAccumulateSingleUse() { target.accumulate(new AnalysisRecord("Word", LINE_10)); validate("Word", 1, LINE_10); }
@Test public void testAccumulateTwoUsesSameLine() { target.accumulate(new AnalysisRecord("Word", LINE_10)); target.accumulate(new AnalysisRecord("WORD", LINE_10)); validate("Word", 2, LINE_10); }
@Test public void testAccumulateTwoUsesDifferentLines() { target.accumulate(new AnalysisRecord("WORD", LINE_20)); target.accumulate(new AnalysisRecord("Word", LINE_10)); validate("Word", 2, LINE_10, LINE_20); }