SpacesFilter { public List<String> filter(List<String> spaces) { List<String> results = new ArrayList<String>(); results.addAll(spaces); results.removeAll(Constants.SYSTEM_SPACES); return results; }  List<String> filter(List<String> spaces);  }
@Test public void testFilter() throws ContentStoreException { SpacesFilter filter = new SpacesFilter(); String[] spaces = {"space1", "space2", "space3"}; List<String> spacesList = Arrays.asList(spaces); List<String> result = filter.filter(spacesList); Assert.assertNotNull(result); Assert.assertEquals(spaces.length, result.size()); spacesList = new LinkedList<String>(); for (String systemSpace : Constants.SYSTEM_SPACES) { spacesList.add(systemSpace); } result = filter.filter(spacesList); Assert.assertEquals(0, result.size()); }