ShapeInMemLayer extends FeatureSourceRetriever implements VectorLayer { @Override public Object read(String featureId) throws LayerException { if (!features.containsKey(featureId)) { throw new LayerException(ExceptionCode.LAYER_MODEL_FEATURE_NOT_FOUND, featureId); } else { return features.get(featureId); } }  @Override String getId(); void setId(String id); @Override CoordinateReferenceSystem getCrs(); @Api void setLayerInfo(VectorLayerInfo layerInfo); @Override VectorLayerInfo getLayerInfo(); @Override boolean isCreateCapable(); @Override boolean isUpdateCapable(); @Override boolean isDeleteCapable(); @Api void setUrl(String url); Iterator<?> getElements(Filter filter, int offset, int maxResultSize); @Override Envelope getBounds(); Envelope getBounds(Filter filter); @Override FeatureModel getFeatureModel(); @Override Object create(Object feature); @Override Object read(String featureId); @Override Object saveOrUpdate(Object feature); @Override void delete(String featureId);  }
@Test public void read() throws Exception { SimpleFeature f = (SimpleFeature) layer.read(LAYER_NAME + ".2"); Assert.assertNotNull(f); Assert.assertEquals("Vatican City", f.getAttribute("NAME")); }