@Test
public void testDeselectLayer() {
org.geomajas.layer.feature.Feature dto1 = new org.geomajas.layer.feature.Feature();
dto1.setId("feat1");
Feature feature1 = new Feature(dto1, layer1);
org.geomajas.layer.feature.Feature dto2 = new org.geomajas.layer.feature.Feature();
dto2.setId("feat2");
Feature feature2 = new Feature(dto2, layer1);
Assert.assertFalse(feature1.isSelected());
Assert.assertFalse(feature2.isSelected());
Assert.assertEquals(0, selectedCount);
Assert.assertEquals(0, deselectedCount);
mapModel.selectLayer(layer1);
Assert.assertFalse(feature1.isSelected());
Assert.assertFalse(feature2.isSelected());
Assert.assertEquals(0, selectedCount);
Assert.assertEquals(0, deselectedCount);
layer1.selectFeature(feature1);
layer1.selectFeature(feature2);
Assert.assertTrue(feature1.isSelected());
Assert.assertTrue(feature2.isSelected());
Assert.assertEquals(2, selectedCount);
Assert.assertEquals(0, deselectedCount);
mapModel.selectLayer(layer1);
Assert.assertTrue(feature1.isSelected());
Assert.assertTrue(feature2.isSelected());
Assert.assertEquals(2, selectedCount);
Assert.assertEquals(0, deselectedCount);
mapModel.selectLayer(layer2);
Assert.assertTrue(feature1.isSelected());
Assert.assertTrue(feature2.isSelected());
Assert.assertEquals(2, selectedCount);
Assert.assertEquals(0, deselectedCount);
}