### Question:
GeoToolsLayer extends FeatureSourceRetriever implements VectorLayer { void update(Object feature) throws LayerException { SimpleFeatureSource source = getFeatureSource(); if (source instanceof SimpleFeatureStore) { SimpleFeatureStore store = (SimpleFeatureStore) source; String featureId = getFeatureModel().getId(feature); Filter filter = filterService.createFidFilter(new String[] { featureId }); transactionSynchronization.synchTransaction(store); List<Name> names = new ArrayList<Name>(); Map<String, Attribute> attrMap = getFeatureModel().getAttributes(feature); List<Object> values = new ArrayList<Object>(); for (Map.Entry<String, Attribute> entry : attrMap.entrySet()) { String name = entry.getKey(); names.add(store.getSchema().getDescriptor(name).getName()); values.add(entry.getValue().getValue()); } try { store.modifyFeatures(names.toArray(new Name[names.size()]), values.toArray(), filter); store.modifyFeatures(store.getSchema().getGeometryDescriptor().getName(), getFeatureModel() .getGeometry(feature), filter); log.debug("Updated feature {} in {}", featureId, getFeatureSourceName()); } catch (IOException ioe) { featureModelUsable = false; throw new LayerException(ioe, ExceptionCode.LAYER_MODEL_IO_EXCEPTION); } } else { log.error("Don't know how to create or update " + getFeatureSourceName() + ", class " + source.getClass().getName() + " does not implement SimpleFeatureStore"); throw new LayerException(ExceptionCode.CREATE_OR_UPDATE_NOT_IMPLEMENTED, getFeatureSourceName(), source .getClass().getName()); } }  @Override String getId(); @Api void setId(String id); @Api void setUrl(String url); @Api void setDbtype(String dbtype); @Api DataSource getDataSource(); @Api void setDataSource(DataSource dataSource); @Api void setParameters(List<Parameter> parameters); @Api void setCooldownTimeBetweenInitializationRetries(long cooldownTimeBetweenInitializationRetries); @Override CoordinateReferenceSystem getCrs(); @Api void setLayerInfo(VectorLayerInfo layerInfo); @Override VectorLayerInfo getLayerInfo(); @Override boolean isCreateCapable(); @Override boolean isUpdateCapable(); @Override boolean isDeleteCapable(); @Override @Deprecated void setDataStore(DataStore dataStore); @Override @Transactional(rollbackFor = { Throwable.class }) Object create(Object feature); @Override @Transactional(rollbackFor = { Throwable.class }) void delete(String featureId); @Override @Transactional(rollbackFor = { Throwable.class }) Object saveOrUpdate(Object feature); @Override Object read(String featureId); @Override Envelope getBounds(); @Override Envelope getBounds(Filter filter); @Transactional(readOnly = true) Iterator<?> getElements(Filter filter, int offset, int maxResultSize); @Override FeatureModel getFeatureModel(); @Override DataStore getDataStore(); @Override SimpleFeatureSource getFeatureSource();  }### Answer:
@Test public void testUpdate() throws Exception { SimpleFeature f = (SimpleFeature) layer.read(LAYER_NAME + ".3"); f.setAttribute("NAME", "Luxembourg2"); layer.update(f); Assert.assertEquals("Luxembourg2", f.getAttribute(ATTRIBUTE_NAME)); }