BrowseRequest req = new BrowseRequest();
FacetSpec fspec = new FacetSpec();
req.setFacetSpec("groupby", fspec);
HashMap<String,List<BrowseFacet>> answer=new HashMap<String,List<BrowseFacet>>();
answer.put("groupby", Arrays.asList(new BrowseFacet[]{new BrowseFacet("red,rectangle,0011",1),new BrowseFacet("red,square,0005",1),new BrowseFacet("red,square,0010",1)}));
BrowseSelection sel=new BrowseSelection("groupby");
sel.addValue("red");
req.addSelection(sel);
doTest(req,3,answer,null);
sel.setValues(new String[]{"red,square"});
answer.put("groupby", Arrays.asList(new BrowseFacet[]{new BrowseFacet("red,square,0005",1),new BrowseFacet("red,square,0010",1)}));
doTest(req,2,answer,null);
sel.setValues(new String[]{"red,square,0005"});
answer.put("groupby", Arrays.asList(new BrowseFacet[]{new BrowseFacet("red,square,0005",1)}));
doTest(req,1,answer,null);
req.removeSelection("groupby");
fspec.setMaxCount(2);
answer.put("groupby", Arrays.asList(new BrowseFacet[]{new BrowseFacet("blue,circle,0913",1),new BrowseFacet("blue,square,1013",1)}));
doTest(req,7,answer,null);
}