code: private static String simpleName(Class<?> clazz) {
          String name = clazz.getName();
  
          // the nth anonymous class has a class name ending in "Outer$n"
          // and local inner classes have names ending in "Outer.$1Inner"
          name = name.replaceAll("\\$[0-9]+", "\\$");
  
          // we want the name of the inner class all by its lonesome
          int start = name.lastIndexOf('$');
  
          // if this isn't an inner class, just find the start of the
          // top level class name.
          if (start == -1) {
              start = name.lastIndexOf('.');
          }
          return name.substring(start + 1);
      }
docs: {@link Class#getSimpleName()} is not GWT compatible yet, so we
  provide our own implementation.