SlotListImpl implements SlotList<T> { @Override public Slot find(T listener) { for (Slot slot : list) { if (slot.listener() == listener) { return slot; } } return null; }  @Override int size(); @Override boolean add(Slot slot); @Override void remove(Slot slot); @Override Slot find(T listener); @Override Iterator<Slot> iterator(); @Override void clear();  }
@Test public void find() throws Exception { assertEquals(slotList.find(listeners[3]).listener(), listeners[3]); assertThat(slotList.find(null), nullValue()); assertThat(slotList.find(mock(Runnable.class)), nullValue()); }