@Test public void Han2Latin_Names() { StringBuilder builder = new StringBuilder(); for (Map.Entry<String, String> entry : testMap.entrySet()) { String target = entry.getKey(); String expected = entry.getValue(); String actual = transliterator.transliterate(target); if (!expected.contentEquals(actual)) { builder.append(String.format( "\nExpected '%s' to be '%s', but actually is '%s'.", target, expected, actual)); } } if (builder.length() > 0) { throw new RuntimeException(builder.toString()); } }
@Nullable private String transliterate(Transliterator transliterator, @Nullable String text) { if (text == null) { return null; } String result = transliterator.transliterate(text); if (result == null || result.isEmpty()) { return null; } return result; }
ContactFixer { @Nullable private String transliterate(Transliterator transliterator, @Nullable String text) { if (text == null) { return null; } String result = transliterator.transliterate(text); if (result == null || result.isEmpty()) { return null; } return result; } }
ContactFixer { @Nullable private String transliterate(Transliterator transliterator, @Nullable String text) { if (text == null) { return null; } String result = transliterator.transliterate(text); if (result == null || result.isEmpty()) { return null; } return result; } ContactFixer(Context context); }
ContactFixer { @Nullable private String transliterate(Transliterator transliterator, @Nullable String text) { if (text == null) { return null; } String result = transliterator.transliterate(text); if (result == null || result.isEmpty()) { return null; } return result; } ContactFixer(Context context);  }
ContactFixer { @Nullable private String transliterate(Transliterator transliterator, @Nullable String text) { if (text == null) { return null; } String result = transliterator.transliterate(text); if (result == null || result.isEmpty()) { return null; } return result; } ContactFixer(Context context);   }