### Question:
JsdUtil { static String flipName(String name) { int i = name.lastIndexOf('$'); if (i != -1) name = name.replace('$', '-'); else if ((i = name.lastIndexOf('-')) != -1) name = name.replace('-', '$'); else i = name.lastIndexOf('.'); return i == -1 ? Strings.flipFirstCap(name) : name.substring(0, i + 1) + Strings.flipFirstCap(name.substring(i + 1)); } private  JsdUtil();   }### Answer:
@Test public void testFlipName() { assertEquals("Cat", JsdUtil.flipName("cat")); assertEquals("Cat", JsdUtil.flipName("cat")); assertEquals("Cat", JsdUtil.flipName("cat")); assertEquals("CAT", JsdUtil.flipName("CAT")); assertEquals("CAT", JsdUtil.flipName("CAT")); assertEquals("CAT", JsdUtil.flipName("CAT")); assertEquals("a.b.Cat", JsdUtil.flipName("a.b.cat")); assertEquals("a.b-Cat", JsdUtil.flipName("a.b$cat")); assertEquals("a.b$Cat", JsdUtil.flipName("a.b-cat")); assertEquals("a.b.CAT", JsdUtil.flipName("a.b.CAT")); assertEquals("a.b-CAT", JsdUtil.flipName("a.b$CAT")); assertEquals("a.b$CAT", JsdUtil.flipName("a.b-CAT")); }