WebSocketContextImpl implements WebSocketContext { @SuppressWarnings("unchecked") @Override public <V> List<Channel<V>> all() { List<Channel<V>> results = new ArrayList<>(channels.size()); for (Channel<?> channel : channels.values()) { results.add((Channel<V>) channel); } return results; }  @SuppressWarnings("unchecked") @Override List<Channel<V>> all(); @SuppressWarnings("unchecked") @Override List<Channel<V>> room(String name);  }
@Test void all() { var channel = new ChannelImpl<TestWebSocketMessage, TestWebSocketMessage>(null, context, null); context.add(channel); List<Channel<TestWebSocketMessage>> all = context.all(); assertThat(all).containsOnly(channel); context.remove(channel); assertThat(context.all()).isEmpty(); }