FacetSpec shapeSpec = new FacetSpec();
shapeSpec.setOrderBy(FacetSortSpec.OrderValueAsc);
br.setFacetSpec("shape", shapeSpec);
HashMap<String,List<BrowseFacet>> answer=new HashMap<String,List<BrowseFacet>>();
answer.put("color", Arrays.asList(new BrowseFacet[]{new BrowseFacet("red",3),new BrowseFacet("blue",2),new BrowseFacet("green",2)}));
answer.put("shape", Arrays.asList(new BrowseFacet[]{new BrowseFacet("circle",2),new BrowseFacet("rectangle",2),new BrowseFacet("square",3)}));
doTest(br,7,answer,null);
Comparator<BrowseFacet> valComp = new FacetValueComparatorFactory().newComparator();
int v = valComp.compare(new BrowseFacet("red",3), new BrowseFacet("blue",2));
assertTrue(v>0);
valComp = new FacetHitcountComparatorFactory().newComparator();
v = valComp.compare(new BrowseFacet("red",3), new BrowseFacet("blue",2));
assertTrue(v<0);
v = valComp.compare(new BrowseFacet("red",3), new BrowseFacet("blue",3));
assertTrue(v>0);
}