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

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