### Question:
DictionaryLoader { E load(InputStream inputStream) throws IOException { E e = supplier.get(); try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8))) { bufferedReader.lines().forEach(line -> loader.accept(e, line)); } return e; } DictionaryLoader(Supplier<E> supplier, BiConsumer<E, String> loader); E loadCachedFromResource(String path, String dictionaryName); E loadCachedFromFile(File file, String dictionaryName);  }### Answer:
@Test void testCreateWordList() throws IOException { String sampleWordSet = "Saitama\n"; sampleWordSet += "Gumma\n"; sampleWordSet += "Gifu\n"; Set<String> result = WORD_LIST.load(new ByteArrayInputStream(sampleWordSet.getBytes(StandardCharsets.UTF_8))); assertEquals(3, result.size()); }
@Test void testCreateVacantWordList() throws IOException { String sampleWordSet = ""; Set<String> result = WORD_LIST.load(new ByteArrayInputStream(sampleWordSet.getBytes(StandardCharsets.UTF_8))); assertEquals(0, result.size()); }
@Test void testCreateKeyValueList() throws IOException { String sampleWordSet = "Saitama\t100\n"; sampleWordSet += "Gumma\t530000\n"; sampleWordSet += "Gifu\t1200\n"; Map<String, String> result = KEY_VALUE.load(new ByteArrayInputStream(sampleWordSet.getBytes(StandardCharsets.UTF_8))); assertEquals(3, result.size()); assertEquals("100", result.get("Saitama")); assertEquals("530000", result.get("Gumma")); assertEquals("1200", result.get("Gifu")); }
@Test void testCreateVacantKeyValueList() throws IOException { String sampleWordSet = ""; Map<String, String> result = KEY_VALUE.load(new ByteArrayInputStream(sampleWordSet.getBytes(StandardCharsets.UTF_8))); assertEquals(0, result.size()); }