ListOfOrderedSentencesGenerator { public Map<String, Integer> adjustWordFrequencies(String topWeightedSentence) { Map<String, Integer> newFrequencies = new HashMap<>(wordFrequencies); Collection<String> wordsInSentence = sentenceToWordsStringMap.get(topWeightedSentence); for (String word : wordsInSentence) { int numberOfTimesWordOccursInSentence = Collections.frequency(wordsInSentence, word); int newFrequency = wordFrequencies.get(word) - numberOfTimesWordOccursInSentence; newFrequencies.put(word, newFrequency); } return newFrequencies; } ListOfOrderedSentencesGenerator(
      Map<T, List<String>> sentenceToWordsStringMap,
      Map<String, Integer> wordFrequencies,
      int numberOfWordsAboveThreshold); List<T> getSortedSentences(); Map<String, Integer> adjustWordFrequencies(String topWeightedSentence);  }
@Test public void testAdjustWordFrequencies() { Map<String, Integer> adjustedFrequencies = listOfOrderedSentencesGenerator.adjustWordFrequencies(SENTENCE_1); assertEquals( "Adjusted frequency of 'This' should be 0", 0, (int) adjustedFrequencies.get("This")); assertEquals("Adjusted frequency of 'is' should be 1", 1, (int) adjustedFrequencies.get("is")); }