public static boolean isAnonymous(String className){
  int i=className.lastIndexOf('$');
  if (i >= 0 && ++i < className.length()) {
    while (i < className.length()) {
      if (!Character.isDigit(className.charAt(i))) {
        return false;
      }
      i++;
    }
    return true;
  }
  return false;
}

public static boolean isAnonymous ( String className ) { int i = className . lastIndexOf ( '$' ) ; if ( i >= 0 && ++ i < className . length ( ) ) { while ( i < className . length ( ) ) { if ( ! Character . isDigit ( className . charAt ( i ) ) ) { return false ; } i ++ ; } return true ; } return false ; }
does a class name appear to designate an anonymous class ? only the name is analyzed . no classes are loaded or looked up .
