InstrumentedSseBroadcaster extends SseBroadcaster implements Predicate<String> { @Override public <OUT extends ChunkedOutput<OutboundEvent>> boolean add(final OUT chunkedOutput) { if (chunkedOutput.isClosed()) { return false; } final boolean result = super.add(chunkedOutput); if (result) { final int active = connectionCounter.incrementAndGet(); LOGGER.debug("Opened new connection ({} total)", active); } return result; } InstrumentedSseBroadcaster(); @Override boolean add(final OUT chunkedOutput); @Override void onException(
      final ChunkedOutput<OutboundEvent> chunkedOutput, final Exception exception); @Override void onClose(final ChunkedOutput<OutboundEvent> chunkedOutput); @Override void broadcast(final OutboundEvent chunk); @Override boolean test(final String event); void ping(); boolean isEmpty();  }
@Test public void testAdd() { final InstrumentedSseBroadcaster broadcaster = new InstrumentedSseBroadcaster(); assertThat(broadcaster.isEmpty()).isTrue(); final EventOutput output = new EventOutput(); broadcaster.add(output); assertThat(broadcaster.isEmpty()).isFalse(); }