KanjiUtils { public static Integer getJlptLevel(final Character kanji) { return JLPT_LEVEL.get(kanji); } 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 testJlpt() { assertEquals((Integer) 5, KanjiUtils.getJlptLevel('山')); assertEquals((Integer) 4, KanjiUtils.getJlptLevel('週')); assertEquals((Integer) 3, KanjiUtils.getJlptLevel('商')); assertEquals((Integer) 1, KanjiUtils.getJlptLevel('司')); assertNull(KanjiUtils.getJlptLevel('可')); assertEquals((Integer) 2, KanjiUtils.getJlptLevel('庁')); }