SetBackedList extends AbstractSequentialList<T> implements Set<T> { @Override public boolean contains(Object o) { return set.contains(o); } SetBackedList(Set<T> set); @Override int size(); ListIterator<T> listIterator(int index); @Override boolean contains(Object o); @Override int hashCode(); @Override boolean equals(Object o); @Override Spliterator<T> spliterator();  }
@Test public void testContains() throws Exception { LinkedHashSet set = new LinkedHashSet(asList(1, 2, 3, 4, 5)); SetBackedList list = new SetBackedList(set); assertEquals(true, list.contains(1)); assertEquals(true, list.contains(3)); assertEquals(false, list.contains(7)); assertEquals(false, list.containsAll(asList(1,2,8))); assertEquals(true, list.containsAll(asList(1,2,5))); }