code: @SuppressWarnings("unchecked")
      public static Class<Object> getAnonymousInnerClassType(Class<?> declaringClass, int occurrence)
              throws ClassNotFoundException {
          return (Class<Object>) Class.forName(declaringClass.getName() + "$" + occurrence);
      }
docs: Get the type of an anonymous inner class.
  
  @param declaringClass The class in which the anonymous inner class is declared.
  @param occurrence     The occurrence of the anonymous inner class. For example if
  you have two anonymous inner classes classes in the
  {@code declaringClass} you must pass in {@code 1} if
  you want to get the type for the first one or {@code 2}
  if you want the second one.
  @return The type.
  @throws ClassNotFoundException the class not found exception