public static int parseDocuments(String feedFile, int maxDocuments, Consumer<Predicate> consumer) throws IOException {
        try (BufferedReader reader = new BufferedReader(new FileReader(feedFile), 8 * 1024)) {
            reader.mark(1);
            String line = reader.readLine();
            boolean xmlFeed = line.startsWith("<");
            reader.reset();
            return xmlFeed
                    ? parseXmlFeedFile(reader, maxDocuments, consumer)
                    : parseJsonFeedFile(reader, maxDocuments, consumer);
        }
    }
Parses a feed file containing documents in JSON format. Its implementation is based on the following assumptions:
 1. Each document has single predicate field.
 2. The predicate is stored in a field named "boolean".
 3. There is just one "boolean" field on each line

 @author bjorncs
predicate-search/src/main/java/com/yahoo/search/predicate/utils/VespaFeedParser.java