### Question:
SlowLog implements Iterable<SlowLog.Entry> { @Override public String toString() { StringBuilder sb = new StringBuilder("Limit: ").append(limit).append("\n"); for (Entry entry : slowQueries) { sb.append("\t").append(entry.queryId).append(" [").append(entry.time).append("ns]\n"); } return sb.toString(); }  void setLimit(long limit); long getLimit(); void addQuery(String query, long time); void addAll(Iterable<SlowLog.Entry> queries); @Override Iterator<Entry> iterator(); @Override String toString();  }### Answer:
@Test public void testSlowLog() throws IOException, UpdateException { try (Monitor monitor = new Monitor(new SlowQueryParser(250), new MatchAllPresearcher())) { monitor.update(new MonitorQuery("1", "slow"), new MonitorQuery("2", "fast"), new MonitorQuery("3", "slow")); InputDocument doc1 = InputDocument.builder("doc1").build(); Matches<QueryMatch> matches = monitor.match(doc1, SimpleMatcher.FACTORY); System.out.println(matches.getSlowLog()); assertThat(matches.getSlowLog().toString()) .contains("1 [") .contains("3 [") .doesNotContain("2 ["); monitor.setSlowLogLimit(1); assertThat(monitor.match(doc1, SimpleMatcher.FACTORY).getSlowLog().toString()) .contains("1 [") .contains("2 [") .contains("3 ["); monitor.setSlowLogLimit(2000000000000L); assertThat(monitor.match(doc1, SimpleMatcher.FACTORY).getSlowLog()) .isEmpty(); } }