Util { public static String getFeatureName(SimpleFeature simpleFeature) { if (simpleFeature.getAttribute("name") != null) { return simpleFeature.getAttribute("name").toString(); } else if (simpleFeature.getAttribute("NAME") != null) { return simpleFeature.getAttribute("NAME").toString(); } return simpleFeature.getID(); }  static String getFeatureName(SimpleFeature simpleFeature); static double getBinWidth(Histogram histogram); static int computeBinCount(int accuracy); static final int MAX_ACCURACY; }
@Test public void testGetFeatureName() throws Exception { assertEquals("myName", Util.getFeatureName(createFeature("name", "myName"))); assertEquals("myOtherName", Util.getFeatureName(createFeature("NAME", "myOtherName"))); assertEquals("someThirdName", Util.getFeatureName(createFeature("NAME", "someThirdName"))); assertEquals("id", Util.getFeatureName(createFeature("noName", "myName"))); }