@Test
  public void registerListener() {
    AbstractSignalNotificationHandler signalHandler = createSignalNotificationHandler();

    SignalListener mockListenerOne = mock(SignalListener.class, "SIGALL1");
    SignalListener mockListenerTwo = mock(SignalListener.class, "SIGALL2");

    assertThat(signalHandler.isListening(mockListenerOne)).isFalse();
    assertThat(signalHandler.isListening(mockListenerTwo)).isFalse();

    for (Signal signal : Signal.values()) {
      assertThat(signalHandler.hasListeners(signal)).isFalse();
      assertThat(signalHandler.isListening(mockListenerOne, signal)).isFalse();
      assertThat(signalHandler.isListening(mockListenerTwo, signal)).isFalse();
    }

    assertThat(signalHandler.registerListener(mockListenerOne)).isTrue();
    assertThat(signalHandler.registerListener(mockListenerTwo)).isTrue();
    assertThat(signalHandler.registerListener(mockListenerTwo)).isFalse();
    assertThat(signalHandler.isListening(mockListenerOne)).isTrue();
    assertThat(signalHandler.isListening(mockListenerTwo)).isTrue();

    for (Signal signal : Signal.values()) {
      assertThat(signalHandler.hasListeners(signal)).isTrue();
      assertThat(signalHandler.isListening(mockListenerOne, signal)).isTrue();
      assertThat(signalHandler.isListening(mockListenerTwo, signal)).isTrue();
    }
  }
Unit tests for {@link AbstractSignalNotificationHandler}.

@since GemFire 7.0
geode-core/src/test/java/org/apache/geode/internal/process/signal/AbstractSignalNotificationHandlerTest.java