public Collection<Workspace> findByTags(String[] filter) { assert filter != null; Collection<Workspace> result; if (filter.length == 0) { result = workspaceRepository.findAll(); } else { result = new ArrayList<Workspace>(); for (String tag : filter) { if (result.isEmpty()) { result = workspaceRepository.findByTagName(tag); } else { result.retainAll(workspaceRepository.findByTagName(tag)); } } } assert result != null; return result; }
public List<Workspace> findAll() { return workspaceRepository.findAll(); }