@Override
    public synchronized <T extends EventListener<?>> boolean removeListener(final EventType eventType, final T eventListener) {
        if (eventType == null || eventListener == null) {
            return false;
        }
        final EventListener<?>[] listeners = this.listenerMap.get(eventType);
        if (listeners == null) {
            return false;
        }
        final int length = listeners.length;
        if (length == 1) {
            if (listeners[0].equals(eventListener)) {
                this.listenerMap.remove(eventType);
                return true;
            }
            return false;
        }

        boolean found = false;
        int index = -1;
        for (int i = 0; i < length; i++) {
            if (listeners[i].equals(eventListener)) {
                found = true;
                index = i;
                break;
            }
        }

        if (!found) {
            return false;
        }

        final EventListener<?>[] array = new EventListener<?>[length - 1];
        System.arraycopy(listeners, 0, array, 0, index);
        System.arraycopy(listeners, index + 1, array, index, length - index - 1);

        this.listenerMap.put(eventType, array);
        return true;
    }
@Test
    void testRemoveListenerWithNullParameters() {
        assertFalse(this.instance.removeListener(null, null));
        assertFalse(this.instance.removeListener(EventType.HANDSHAKE, null));
        assertFalse(this.instance.removeListener(null, ignored -> {
        }));
    }