SimpleFeature f1 = b.buildFeature(null, new Object[] { "Steve", 32 });
SimpleFeature f2 = b.buildFeature(null, new Object[] { null, null });
SimpleFeature f3 = b.buildFeature(null, new Object[] { null, null });
Name compareName = new FeatureComparators.Name("name");
// f1 has name, f2 has null name, expecting that f1 is greater g2
assertTrue(compareName.compare(f1, f2) > 0);
assertTrue(compareName.compare(f2, f1) < 0);
assertTrue(compareName.compare(f2, f3) == 0);
Name compareNumber = new FeatureComparators.Name("name");
// f1 has number, f2 has null number, expecting that f1 is greater g2
assertTrue(compareNumber.compare(f1, f2) > 0);
assertTrue(compareNumber.compare(f2, f1) < 0);
assertTrue(compareNumber.compare(f2, f3) == 0);
}