package de.schlegel11.eventdispatcher;

import java.util.EventListener;
import java.util.Objects;

/**
 * Created by schlegel11 on 05.11.14.
 */
final class EventListenerWrapper {

    public final static int INFINITE_CALLS = -1;
    private final EventListener listener;
    private final int maxCalls;
    private int currentCalls;

    public EventListenerWrapper(EventListener listener, int maxCalls) {
        this.listener = listener;
        this.maxCalls = maxCalls;
    }

    public EventListener getListener() {
        return listener;
    }

    public int getMaxCalls() {
        return maxCalls;
    }

    public int getCurrentCalls() {
        return currentCalls;
    }

    public void addCurrentCalls(int currentCalls) {
        this.currentCalls += currentCalls;
    }

    @Override
    public int hashCode() {
        return Objects.hash(listener);
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null || getClass() != obj.getClass()) {
            return false;
        }
        final EventListenerWrapper other = (EventListenerWrapper) obj;
        return Objects.equals(this.listener, other.listener);
    }
}

@@ -174,16 +174,101 @@
 pper %7B%0A%0A
+    public static final EventListenerWrapper DUMMY_ELW = new EventListenerWrapper();%0A
     publ
@@ -308,16 +308,16 @@
 S = -1;%0A
-
     priv
@@ -445,16 +445,22 @@
 Wrapper(
+final 
 EventLis
@@ -474,16 +474,22 @@
 istener,
+ final
  int max
@@ -564,32 +564,99 @@
 axCalls;%0A    %7D%0A%0A
+    private EventListenerWrapper() %7B%0A        this(null, 0);%0A    %7D%0A%0A
     public Event
@@ -878,16 +878,22 @@
 ntCalls(
+final 
 int curr
@@ -1048,32 +1048,32 @@
 %0A%0A    @Override%0A
-
     public boole
@@ -1082,16 +1082,22 @@
  equals(
+final 
 Object o

Add final modifier to method arguments. Add dummy object which represents an empty elw.