CellComparatorHelper { static public String getSanitizedStaticValue(Cell cell) { if (null == cell) { return null; } return null == cell.getStaticValue() ? null : getSanitizedStaticValue(cell.getStaticValue().toString()); }  static String getSanitizedStaticValue(Cell cell); static String getSanitizedStaticValue(String staticValue); static Comparator getAppropriateComparatorForPropertyClass(Class propClass); static Comparator getAppropriateValueComparatorForPropertyClass(Class propClass);  }
@Test public void testExtractFromHref() { String href = "<a style=\"color: red;\" href=\"inquiry.do?businessObjectClassName=org.kuali.rice.krad.bo.Options&amp;universityFiscalYear=2004&amp;methodToCall=start\" target=\"blank\">needle</a>"; Cell cell = new Cell(href); assertEquals(CellComparatorHelper.getSanitizedStaticValue(cell), "needle"); }
@Test public void testExtractFromHrefAndRemoveNbsp() { String href = "<a href=\"haystack\">needle&nbsp;</a>"; Cell cell = new Cell(href); assertEquals(CellComparatorHelper.getSanitizedStaticValue(cell), "needle"); }
@Test public void testRemoveNbsp() { String bad = "needle&nbsp;"; Cell cell = new Cell(bad); assertEquals(CellComparatorHelper.getSanitizedStaticValue(cell), "needle"); }
@Test public void testLeaveSimpleValueAlone() { String good = "needle"; Cell cell = new Cell(good); assertEquals(CellComparatorHelper.getSanitizedStaticValue(cell), "needle"); }
@Test public void testMessyHref() { String href = "<a onClick=\"foo();\" href=\"haystack\" class=\"my favorite class\" >needle</a>&nbsp;"; Cell cell = new Cell(href); assertEquals(CellComparatorHelper.getSanitizedStaticValue(cell), "needle"); }