ResourceKeyFormatter { public String formatKey(@NonNull final String name, @Nullable final String family) { if (TextUtils.isEmpty(family)) { return name; } else { return family.concat("_").concat(name); } }  String formatKey(@NonNull final String name,
                            @Nullable final String family); String formatKey(@Nullable final String prefix,
                            @NonNull final String name,
                            @Nullable final String family);  }
@Test public void testFormatKey1() throws Exception { assertEquals(KEY, mFormatter.formatKey(KEY, null)); assertEquals(FAMILY + "_" + KEY, mFormatter.formatKey(KEY, FAMILY)); }
@Test public void testFormatKey() throws Exception { assertEquals(KEY, mFormatter.formatKey(null, KEY, null)); assertEquals(FAMILY + "_" + KEY, mFormatter.formatKey(null, KEY, FAMILY)); assertEquals(PREFIX + FAMILY + "_" + KEY, mFormatter.formatKey(PREFIX, KEY, FAMILY)); }