### Question:
FeatureExt extends Static { public static Map<String,Object> toMap(final Feature att) { ensureNonNull("att", att); final Map<String,Object> map = new HashMap<>(); FeatureLoop.loop(att, (Predicate)null, new BiFunction<PropertyType, Object, Object>() { @Override public Object apply(PropertyType t, Object u) { map.put(t.getName().tip().toString(), u); return u; } }); return map; }  static String createDefaultFeatureId(); @Deprecated static void isValid(Feature feature); static ArrayFeature newArrayInstance(FeatureType type); static FeatureId getId(Feature feature); static void setId(Feature feature, FeatureId id); static Envelope getEnvelope(Feature feature); static boolean hasAGeometry(FeatureType type); static CoordinateReferenceSystem getCRS(FeatureType type); static CoordinateReferenceSystem getCRS(PropertyType type); static T getCharacteristicValue(PropertyType type, String charName, T defaulValue); static Integer getLengthCharacteristic(AttributeType type); static PropertyType getType(Property property); static void copy(Feature feature, Feature copy, boolean deep); static Feature copy(Feature feature); static Feature deepCopy(Feature feature); static Object deepCopy(final Object candidate); static PropertyType getDefaultGeometry(final FeatureType type); static Optional<Object> getDefaultGeometryValue(Feature input); static FeatureType createSubType(FeatureType type, String ... propertyNames); static FeatureType createSubType(FeatureType type, GenericName ... propertyNames); static FeatureType createSubType(FeatureType type, CoordinateReferenceSystem crs, GenericName ... propertyNames); static FeatureType transform(FeatureType type, CoordinateReferenceSystem crs); static ParameterValueGroup toParameter(final Feature source, final ParameterDescriptorGroup desc); static Feature toFeature(final ParameterValueGroup source); static Feature toFeature(final ParameterValueGroup source, FeatureType targetType); static Feature toFeature(final Map<String,?> source, FeatureType targetType); static Map<String,Object> toMap(final Feature att); static Map<String,Object> toMap(final ParameterValueGroup source); static Property toProperty(final ParameterValue parameter); static GeneralParameterValue searchParameter(final ParameterValueGroup group, final String code); static boolean sameProperties(final FeatureType first, final FeatureType second, boolean checkSuperTypes); static boolean sameProperties(final FeatureType first, final FeatureType second, boolean checkSuperTypes, final boolean ignoreConventions); static Function<Feature, Geometry> prepareGeometryExtractor(final FeatureType targetType); static final Logger LOGGER; static final String SEPARATOR; static final GenericName ATTRIBUTE_SYMBOLIZERS; static final Predicate<IdentifiedType> IS_NOT_CONVENTION; }### Answer:
@Test public void featureToMapTest(){ final FeatureTypeBuilder ftb = new FeatureTypeBuilder(); ftb.setName("group"); ftb.addAttribute(String.class).setName("att1").setDefaultValue("testString"); ftb.addAttribute(Integer.class).setName("att2").setMinimumOccurs(0).setMaximumOccurs(21); final FeatureType type = ftb.build(); final Feature feature = type.newInstance(); feature.setPropertyValue("att1", "value1"); feature.setPropertyValue("att2", 45); final Map<String, Object> map = FeatureExt.toMap(feature); assertEquals(2, map.size()); assertEquals("value1", map.get("att1")); assertEquals(45, map.get("att2")); }