FacetFieldValuesProvider extends SortableDataProvider<FacetField.Count, FieldValuesOrder> implements ListProvider<FacetField.Count> { @Override public long size() { if (size == null) { size = getSize(); } return size; } FacetFieldValuesProvider(IModel<FacetField> model, FieldValueConverterProvider fieldValueConverterProvider);  FacetFieldValuesProvider(IModel<FacetField> model, Collection<String> lowPriorityValues, FieldValueConverterProvider fieldValueConverterProvider);  FacetFieldValuesProvider(IModel<FacetField> model, int max, Collection<String> lowPriorityValues, FieldValueConverterProvider fieldValueConverterProvider);  FacetFieldValuesProvider(IModel<FacetField> model, int max, SortParam<FieldValuesOrder> sort, FieldValueConverterProvider fieldValueConverterProvider);  FacetFieldValuesProvider(IModel<FacetField> model, int max, Collection<String> lowPriorityValues, SortParam<FieldValuesOrder> sort, FieldValueConverterProvider fieldValueConverterProvider); @Override Iterator<FacetField.Count> iterator(long first, long count); @Override List<FacetField.Count> getList(); @Override long size(); @Override IModel<FacetField.Count> model(FacetField.Count object); @Override void detach();  }
@Test public void testSize() { { final FacetFieldValuesProvider instance = new FacetFieldValuesProvider(Model.of(facetField), 10, LOW_PRIORITY_VALUES, new SortParam<FieldValuesOrder>(FieldValuesOrder.NAME, false), valueConverterProvider); assertEquals(5, instance.size()); } { final FacetFieldValuesProvider instance = new FacetFieldValuesProvider(Model.of(facetField), 2, LOW_PRIORITY_VALUES, new SortParam<FieldValuesOrder>(FieldValuesOrder.NAME, false), valueConverterProvider); assertEquals(2, instance.size()); } }