KatakanaToHiragana { protected static Stream<String> convert(Stream<String> katakanaStream) { return katakanaStream.map(katakanaToken -> { String fullWidth = KanaUtils.half2FullKatakana(katakanaToken); String specialCharacters = handleSpecialCharacters(fullWidth); final IntStream intStream = handleChoonpu(specialCharacters).codePoints().map(KatakanaToHiragana::toHiragana); return intStream .collect(StringBuilder::new, StringBuilder::appendCodePoint, StringBuilder::append) .toString(); }); } private  KatakanaToHiragana();   }
@Test public void convertHalfWidth() { Stream<String> result = KatakanaToHiragana.convert(Stream.generate(() -> "ｲ")); assertEquals("い", result.findFirst().get()); }
@Test public void convertFullWidth() { Stream<String> result = KatakanaToHiragana.convert(Stream.generate(() -> "イ")); assertEquals("い", result.findFirst().get()); }
@Test public void convertSpecialCharacters() { Stream<String> result = KatakanaToHiragana.convert(Stream.generate(() -> "ヷヸヹヺ・")); assertEquals("ゔぁゔぃゔぇゔぉ・", result.findFirst().get()); }
@Test public void convertString() { Stream<String> result = KatakanaToHiragana.convert(Stream.generate(() -> "ｿﾞ")); assertEquals("ぞ", result.findFirst().get()); }