summaryrefslogtreecommitdiffstats
path: root/mock/jrummikub/util/MockEvent.java
diff options
context:
space:
mode:
Diffstat (limited to 'mock/jrummikub/util/MockEvent.java')
-rw-r--r--mock/jrummikub/util/MockEvent.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/mock/jrummikub/util/MockEvent.java b/mock/jrummikub/util/MockEvent.java
index 2f0efe5..65aec9d 100644
--- a/mock/jrummikub/util/MockEvent.java
+++ b/mock/jrummikub/util/MockEvent.java
@@ -6,8 +6,15 @@ public class MockEvent implements IEvent {
public HashSet<IListener> listeners = new HashSet<IListener>();
@Override
- public void add(IListener listener) {
+ public Connection add(final IListener listener) {
listeners.add(listener);
+ return new Connection() {
+
+ @Override
+ public void remove() {
+ MockEvent.this.remove(listener);
+ }
+ };
}
@Override