@Test public void testMapByWordLength() { Map<Integer, ArrayList<Word>> lengthWordMap = BasicWordMapDao.mapByWordLength(wordsToReturn); assertEquals(10, lengthWordMap.size()); for (Word word : wordsToReturn) { assertTrue(lengthWordMap.get(word.getWord().length()).contains(word)); } }
@Test public void testMapByPartOfSpeech() { Map<PartOfSpeechType, ArrayList<Word>> partOfSpeechWordMap = BasicWordMapDao.mapByPartOfSpeech(wordsToReturn); assertEquals(10, partOfSpeechWordMap.size()); for (Word word : wordsToReturn) { assertTrue(partOfSpeechWordMap.get(word.getPartOfSpeech()).contains(word)); } }