private static String approximateSimpleName(Class<?> clazz, boolean dropOuterClassNames) {
    checkArgument(!clazz.isAnonymousClass(), "Attempted to get simple name of anonymous class");
    return approximateSimpleName(clazz.getName(), dropOuterClassNames);
  }
@Test
  public void testDropsOuterClassNamesTrue() {
    assertEquals("Bar", NameUtils.approximateSimpleName("Foo$1$Bar", true));
    assertEquals("Foo$1", NameUtils.approximateSimpleName("Foo$1", true));
    assertEquals("Foo$1$2", NameUtils.approximateSimpleName("Foo$1$2", true));
  }