code: public static String simpleClassName(Class<?> clazz) {
          if (!clazz.isAnonymousClass()) {
              return clazz.getSimpleName();
          }
          // Simple name of anonymous class is empty
          String name = clazz.getName();
          int lastDot = name.lastIndexOf('.');
          if (lastDot <= 0) {
              return name;
          }
          return name.substring(lastDot + 1);
      }
docs: Returns the simple name of a class. Contrary to
  {@link Class#getSimpleName()}, this method returns
  the last segement of the full name for anonymous
  classes (instead of an empty string).
  
  @param clazz the class
  @return the name