code: public static boolean isNonStaticInnerClass(Class<?> clazz) {
  		if (clazz.getEnclosingClass() == null) {
  			// no inner class
  			return false;
  		} else {
  			// inner class
  			if (clazz.getDeclaringClass() != null) {
  				// named inner class
  				return !Modifier.isStatic(clazz.getModifiers());
  			} else {
  				// anonymous inner class
  				return true;
  			}
  		}
  	}
docs: Checks, whether the class is an inner class that is not statically accessible. That is especially true for
  anonymous inner classes.
  
  @param clazz The class to check.
  @return True, if the class is a non-statically accessible inner class.