TileSelector { public void selectOnly(Tile<?> tile) { selectedTiles.removeIf(t -> !t.equals(tile)); select(tile); } private  TileSelector(WidgetPane pane); static TileSelector forPane(WidgetPane pane); ObservableSet<Tile<?>> getSelectedTiles(); boolean isSelected(Tile<?> tile); boolean areTilesSelected(); void deselectAll(); void select(Tile<?> tile); void deselect(Tile<?> tile); void toggleSelect(Tile<?> tile); void selectOnly(Tile<?> tile);  }
@Test public void testSelectOnly() { selector.selectOnly(firstTile); assertTrue(firstTile.isSelected(), "First tile should have been selected"); selector.selectOnly(secondTile); assertFalse(firstTile.isSelected(), "First tile should have been deselected"); assertTrue(secondTile.isSelected(), "Second tile should have been selected"); }