((TestLayer)handler.getContext().getMap().getMapLayers().get(0)).setSchema(type);
((Map)handler.getContext().getMap()).getEditManagerInternal().setEditFeature(feature, layer);
// test create LineString
behaviour=new AcceptChangesBehaviour(LineString.class, false);
UndoableMapCommand command = behaviour.getCommand(handler);
command.setMap(handler.getContext().getMap());
command.run(new NullProgressMonitor());
assertFalse(handler.getCurrentGeom().isChanged());
assertEquals(2, ((GeometryCollection)feature.getDefaultGeometry()).getGeometryN(0).getCoordinates().length);
assertEquals(toCoord(bb,10,10), ((GeometryCollection)feature.getDefaultGeometry()).getGeometryN(0).getCoordinates()[0]);
assertEquals(toCoord(bb,40,10), ((GeometryCollection)feature.getDefaultGeometry()).getGeometryN(0).getCoordinates()[1]);
features = layer.getResource(FeatureSource.class, null).getFeatures().features();
next=features.next();
assertEquals(2, ((GeometryCollection)next.getDefaultGeometry()).getGeometryN(0).getCoordinates().length);
assertEquals( toCoord(bb,10,10), ((GeometryCollection)next.getDefaultGeometry()).getGeometryN(0).getCoordinates()[0] );
assertEquals( toCoord(bb,40,10), ((GeometryCollection)next.getDefaultGeometry()).getGeometryN(0).getCoordinates()[1] );
assertEquals(MultiLineString.class, feature.getDefaultGeometry().getClass());
// test create LinearRing
behaviour=new AcceptChangesBehaviour(LinearRing.class, false);
handler.getCurrentGeom().setChanged(true);
command = behaviour.getCommand(handler);
command.setMap(handler.getContext().getMap());
command.run(new NullProgressMonitor());
assertEquals(4, ((GeometryCollection)feature.getDefaultGeometry()).getGeometryN(0).getCoordinates().length);
assertEquals(toCoord(bb,10,10), ((GeometryCollection)feature.getDefaultGeometry()).getGeometryN(0).getCoordinates()[0]);
assertEquals(toCoord(bb,40,10), ((GeometryCollection)feature.getDefaultGeometry()).getGeometryN(0).getCoordinates()[1]);
assertEquals(toCoord(bb,10,10), ((GeometryCollection)feature.getDefaultGeometry()).getGeometryN(0).getCoordinates()[2]);
assertEquals(toCoord(bb,10,10), ((GeometryCollection)feature.getDefaultGeometry()).getGeometryN(0).getCoordinates()[3]);