MongoQueryBuilderFactory implements QueryBuilderFactory { @Override public QueryBuilder newUnlimitedBuilder(final Criteria criteria) { checkCriteria(criteria); return MongoQueryBuilder.unlimited(criteria); } MongoQueryBuilderFactory(final LimitsConfig limitsConfig); @Override QueryBuilder newBuilder(final Criteria criteria); @Override QueryBuilder newUnlimitedBuilder(final Criteria criteria);  }
@Test public void newUnlimitedBuilderWithValidCriteria() { final QueryBuilder builder = underTest.newUnlimitedBuilder(mock(Criteria.class)); assertThat(builder).isInstanceOf(MongoQueryBuilder.class); }
@Test(expected = NullPointerException.class) public void newUnlimitedBuilderWithNullCriteria() { underTest.newUnlimitedBuilder(null); }