CategorizedString extends CategorizedLegend<String> { public String getFallbackValue(){ if(parameter instanceof StringLiteral){ return ((StringLiteral) parameter).getValue(null); } else { return ((Categorize2String)parameter).getFallbackValue().getValue(null); } } CategorizedString(StringParameter sp); @Override SeParameter getParameter(); void setParameter(StringParameter param); String getFallbackValue(); void setFallbackValue(String value); @Override String get(Double d); @Override void put(Double d, String v); @Override String remove(Double d); @Override String getFromLower(Double d);  }
@Test public void testGetFallback() throws Exception{ CategorizedString cs = new CategorizedString(getCategorize2String()); assertTrue(cs.getFallbackValue().equals("fallback")); cs = new CategorizedString(new StringLiteral("yo")); assertTrue(cs.getFallbackValue().equals("yo")); }