### Question:
AbstractEventStoreCommitNotifier implements EventStoreCommitNotifier { @Override @Lock(LockType.WRITE) public void removeListener(String bucketId, EventStoreCommitListener listener) { if (listener == null) throw new IllegalArgumentException("listener must not be null"); List<EventStoreCommitListener> list = listFor(bucketId, false); if (list == null || !list.contains(listener)) throw new IllegalStateException("Listener not found."); list.remove(listener); }  @Override @Lock(LockType.WRITE) void addListener(String bucketId, EventStoreCommitListener listener); @Override @Lock(LockType.WRITE) void removeListener(String bucketId, EventStoreCommitListener listener);  }### Answer:
@Test public void test_remove_nonlistener_fails() { this.clear(); EventStoreCommitNotifier instance = this.instance(); try { instance.removeListener(DEFAULT_BUCKET, this); fail("Should have failed by now"); } catch (Exception e) { } }