KanjiUtils { public static boolean isKatakana(char c) { if (KATAKANA_SPECIALS.contains(c)) { return true; } final String romaji = RomanizationEnum.Hepburn.toRomaji(c); if (romaji.length() == 0 || romaji.charAt(0) == c) { return false; } final char c1 = RomanizationEnum.Hepburn.toKatakana(romaji).charAt(0); return c1 == c; } private  KanjiUtils(); static boolean isHiragana(char c); static boolean isKatakana(char c); static String halfwidthToKatakana(final String halfwidth); static String toHalfwidth(final String katakana); static boolean isHalfwidth(final char ch); static boolean isKana(char ch); static boolean isKanji(char ch); static boolean isJapaneseChar(final char ch); static int getCommonality(final char ch); static int getCommonality(final String str); static Integer getJlptLevel(final Character kanji); static String getJlptKanjis(final int level); static final Map<KanjiQuiz, String> QUIZ_TABLE; }
@Test public void testKatakana() { assertFalse(KanjiUtils.isKatakana('艦')); assertFalse(KanjiUtils.isKatakana('か')); assertTrue(KanjiUtils.isKatakana('キ')); assertTrue(KanjiUtils.isKatakana('ー')); assertFalse(KanjiUtils.isKatakana('っ')); assertFalse(KanjiUtils.isKatakana('ゃ')); assertFalse(KanjiUtils.isKatakana('ゅ')); assertFalse(KanjiUtils.isKatakana('ょ')); assertTrue(KanjiUtils.isKatakana('ャ')); assertTrue(KanjiUtils.isKatakana('ュ')); assertTrue(KanjiUtils.isKatakana('ョ')); }