### Question:
PropertyExistsFunction extends FunctionExpressionImpl { public Object evaluate(SimpleFeature feature) { String propName = getPropertyName(); AttributeDescriptor attributeType = feature.getFeatureType().getDescriptor(propName); return Boolean.valueOf(attributeType != null); } PropertyExistsFunction(); int getArgCount(); Object evaluate(SimpleFeature feature); Object evaluate(Object bean); String toString(); boolean equals(Object obj);  }### Answer:
@Test public void testEvaluateFeature() throws Exception{ SimpleFeatureType type = DataUtilities.createType("ns", "name:string,geom:Geometry"); SimpleFeatureBuilder build = new SimpleFeatureBuilder(type); build.add("testName"); build.add(null); SimpleFeature feature = build.buildFeature(null); f.setParameters(Collections.singletonList(ff.property("nonExistant"))); Assert.assertEquals(Boolean.FALSE, f.evaluate(feature)); f.setParameters(Collections.singletonList(ff.property("name"))); Assert.assertEquals(Boolean.TRUE, f.evaluate(feature)); f.setParameters(Collections.singletonList(ff.property("geom"))); Assert.assertEquals(Boolean.TRUE, f.evaluate(feature)); }
@Test public void testEvaluatePojo() { Citation pojo = new CitationImpl(); f.setParameters(Collections.singletonList(ff.property("edition"))); Assert.assertEquals(Boolean.TRUE, f.evaluate(pojo)); f.setParameters(Collections.singletonList(ff.property("alternateTitles"))); Assert.assertEquals(Boolean.TRUE, f.evaluate(pojo)); f.setParameters(Collections.singletonList(ff.property("AlternateTitles"))); Assert.assertEquals(Boolean.FALSE, f.evaluate(pojo)); f.setParameters(Collections.singletonList(ff.property("nonExistentProperty"))); Assert.assertEquals(Boolean.FALSE, f.evaluate(pojo)); }