private String extractSdName(String sd) {
        String s = sd.split("\n")[0];
        if (s.startsWith("schema"))
            s = s.substring("schema".length()).trim();
        else if (s.startsWith("search"))
            s = s.substring("search".length()).trim();
        else
            throw new IllegalArgumentException("Expected the first line of a schema but got '" + sd + "'");
        int end = s.indexOf(' ');
        if (end < 0)
            end = s.indexOf('}');
        return s.substring(0, end).trim();
    }
To avoid either double parsing or supplying a name explicitly
config-model/src/main/java/com/yahoo/config/model/test/MockApplicationPackage.java