code: public static boolean isFunctionHeader( Object obj ) {
        if( obj instanceof String ){
           String str = (String) obj;
           return str.startsWith( FUNCTION_PREFIX ) && RegexpUtils.getMatcher( FUNCTION_HEADER_PATTERN, true ).matches( str );
        }
        return false;
     }
docs: Tests if obj is javaScript function header.<br>
  Obj must be a non-null String and match "^function[ ]?\\(.*\\)$"