### Question:
InputDocument { public static Builder builder(String id) { return new Builder(id); } protected  InputDocument(String id, Document luceneDocument, PerFieldAnalyzerWrapper analyzers); static Builder builder(String id); String getId(); Document getDocument(); PerFieldAnalyzerWrapper getAnalyzers(); static void checkFieldName(String fieldName); static final String ID_FIELD; }### Answer:
@Test public void testCannotAddReservedFieldName() { expected.expect(IllegalArgumentException.class); expected.expectMessage("reserved"); InputDocument.builder("id").addField(InputDocument.ID_FIELD, "test", new StandardAnalyzer()).build(); }
@Test public void testCannotAddReservedFieldObject() { expected.expect(IllegalArgumentException.class); expected.expectMessage("reserved"); InputDocument.builder("id").addField(new StringField(InputDocument.ID_FIELD, "", Field.Store.YES)).build(); }
@Test public void testOmitNorms() throws Exception { FieldType type = new FieldType(); type.setOmitNorms(true); type.setIndexOptions(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS); Field f = new Field("text", "this is some text that will have a length norm greater than 0", type); InputDocument doc = InputDocument.builder("id") .setDefaultAnalyzer(new StandardAnalyzer()) .addField(f).build(); try (Monitor monitor = new Monitor(new LuceneQueryParser("text"), new MatchAllPresearcher())) { monitor.update(new MonitorQuery("q", "length")); Matches<ExplainingMatch> matches = monitor.match(doc, ExplainingMatcher.FACTORY); DocumentMatches<ExplainingMatch> m = matches.getMatches("id"); for (ExplainingMatch e : m) { Explanation expl = e.getExplanation(); assertThat(expl.toString()).contains("norms omitted"); } } }