KanaUtils { public static String hiragana2FullKatakana(String text) { final IntStream cpStream = text.codePoints().map(c -> { if (('\u3041' <= c && c <= '\u3096') || (c >= '\u309D' && c <= '\u309F')) { return (char) (c + DIFF_FULLKATAKANA_HIRAGANA); } else { return c; } }); return cpStream.collect(StringBuilder::new, StringBuilder::appendCodePoint, StringBuilder::append).toString(); } private  KanaUtils(); static String half2FullKatakana(String katakanaToken); static String hiragana2FullKatakana(String text); static final int DIFF_FULLKATAKANA_HIRAGANA; }
@Test public void hiragana2FullKatakanaTest() { assertEquals("ガギグゲゴ", KanaUtils.hiragana2FullKatakana("がぎぐげご")); assertEquals("パピプペポ", KanaUtils.hiragana2FullKatakana("ぱぴぷぺぽ")); assertEquals("キャキュキョ", KanaUtils.hiragana2FullKatakana("きゃきゅきょ")); assertEquals("ギャギュギョ", KanaUtils.hiragana2FullKatakana("ぎゃぎゅぎょ")); assertEquals("ピャピュピョ", KanaUtils.hiragana2FullKatakana("ぴゃぴゅぴょ")); assertEquals("ヽヾヿ", KanaUtils.hiragana2FullKatakana("ゝゞゟ")); }