@Test public void escapingQueriesTriggerDetach() { when(allowDetach.getAsBoolean()).thenReturn(true); underTest.iterator(); underTest.toArray(); underTest.toArray(new String[0]); InOrder inOrder = inOrder(backing, allowDetach, detach); inOrder.verify(allowDetach).getAsBoolean(); inOrder.verify(backing).size(); inOrder.verify(backing).forEach(anyObject()); verifyNoMoreInteractions(backing, allowDetach, detach); }
@Override public int size() { return backing.size(); }
DetachingSet extends ForwardingSet<V> { @Override public int size() { return backing.size(); } }
DetachingSet extends ForwardingSet<V> { @Override public int size() { return backing.size(); } DetachingSet(final Set<V> backing, final BooleanSupplier allowDetach, final Function<V, V> detach);  DetachingSet(final Set<V> backing, final Function<V, V> detach); }
DetachingSet extends ForwardingSet<V> { @Override public int size() { return backing.size(); } DetachingSet(final Set<V> backing, final BooleanSupplier allowDetach, final Function<V, V> detach);  DetachingSet(final Set<V> backing, final Function<V, V> detach); @Override boolean contains(final Object key); @Override boolean containsAll(final Collection<?> collection); @Override boolean isEmpty(); @Override int size(); @Override boolean equals(final Object object); @Override int hashCode(); @Override String toString(); }
DetachingSet extends ForwardingSet<V> { @Override public int size() { return backing.size(); } DetachingSet(final Set<V> backing, final BooleanSupplier allowDetach, final Function<V, V> detach);  DetachingSet(final Set<V> backing, final Function<V, V> detach); @Override boolean contains(final Object key); @Override boolean containsAll(final Collection<?> collection); @Override boolean isEmpty(); @Override int size(); @Override boolean equals(final Object object); @Override int hashCode(); @Override String toString();  }