code: public static String simpleClassName(Class<?> clazz) {
          Package pkg = clazz.getPackage();
          if (pkg != null) {
              return clazz.getName().substring(pkg.getName().length() + 1);
          } else {
              return clazz.getName();
          }
      }
docs: Generates a simplified name from a {@link Class}.  Similar to {@link Class#getSimpleName()}, but it works fine
  with anonymous classes.