### Question:
ExplainingMatcher extends CandidateMatcher<ExplainingMatch> { public ExplainingMatcher(DocumentBatch docs) { super(docs); } ExplainingMatcher(DocumentBatch docs); @Override void doMatchQuery(String queryId, Query matchQuery, Map<String, String> metadata); @Override ExplainingMatch resolve(ExplainingMatch match1, ExplainingMatch match2); static final MatcherFactory<ExplainingMatch> FACTORY; }### Answer:
@Test public void testExplainingMatcher() throws IOException, UpdateException { try (Monitor monitor = new Monitor(new LuceneQueryParser("field"), new MatchAllPresearcher())) { monitor.update(new MonitorQuery("1", "test"), new MonitorQuery("2", "wibble")); InputDocument doc1 = InputDocument.builder("doc1").addField("field", "test", new StandardAnalyzer()).build(); Matches<ExplainingMatch> matches = monitor.match(doc1, ExplainingMatcher.FACTORY); assertThat(matches.matches("1", "doc1")).isNotNull(); assertThat(matches.matches("1", "doc1").getExplanation()).isNotNull(); } }