The following pseudo code scenario is expected to work but fails
//create some facet requests //enable the facet requests Facet facet1 = facetManager.getFacets( facetGroupName1 ).get( 0 ); facetManager.getFacetGroup( facetGroupName1 ).selectFacets( facet1 ); List<Facet> recomputedFacets = facetManager.getFacets( facetGroupName1 ); Facet almostFacet1 = facetManager.getFacets( facetGroupName1 ).get(0); // Following test fails assertTrue( facetManager.getFacetGroup( facetGroupName1 ).contains( almostFacet1 ) );
This is due to the fact that facet objects are different (between selected ones and recomputed ones) and that equals takes the count into account.
There are two possible fixes: