@Test
  public void emptyResult() throws Exception {
    when(cursor.hasNext()).thenReturn(false);
    check(repository.findAll().fetchAll().getUnchecked()).isEmpty();

    verify(cursor, times(1)).close();
  }
Set of tests to ensure mongo resources are properly closed.

@see MongoCursor#close()
@see <a href="https://docs.mongodb.com/v3.4/reference/method/cursor.close/">cursor.close</a>
mongo/test/org/immutables/mongo/fixture/MongoCursorIsClosedTest.java