static int startsWithAsterisk(String line) {
        if (line.startsWith("*")) {
            return 0;
        } else if ((line.startsWith(" ") || line.startsWith("\t")) && line.length() > 1) {
            int res = startsWithAsterisk(line.substring(1));
            if (res == -1) {
                return -1;
            } else {
                return 1 + res;
            }
        } else {
            return -1;
        }
    }
static int startsWithAsterisk ( String line ) { if ( line . startsWith ( "*" ) ) { return 0 ; } else if ( ( line . startsWith ( " " ) || line . startsWith ( "\t" ) ) && line . length ( ) > 1 ) { int res = startsWithAsterisk ( line . substring ( 1 ) ) ; if ( res == - 1 ) { return - 1 ; } else { return 1 + res ; } } else { return - 1 ; } }
Visible for testing