SparseSet implements Set<String> { public void setPattern(String pattern) { this.pattern = ObjectUtils.isBlank(pattern) ? "" : StringUtils.replaceAll(pattern.trim(), "\\s+", " "); } SparseSet(String pattern);  SparseSet(); String getPattern(); void setPattern(String pattern); @Override boolean add(String item); @Override boolean addAll(Collection<? extends String> collection); @Override void clear(); @Override boolean contains(Object item); @Override boolean containsAll(Collection<?> collection); @Override boolean isEmpty(); @Override Iterator<String> iterator(); @Override boolean remove(Object item); @Override boolean removeAll(Collection<?> collection); @Override boolean retainAll(Collection<?> collection); @Override int size(); @Override Object[] toArray(); @Override T[] toArray(T[] array); @Override boolean equals(Object object); @Override int hashCode(); @Override String toString();  }
@Test public void setPattern() { SparseSet s = new SparseSet(); s.setPattern("+a -a/b"); assertEquals("+a -a/b", s.getPattern()); }