StandardMessenger implements Messenger { public Set<String> getOutgoingChannels() { synchronized (outgoingLock) { Set<String> keys = outgoingByChannel.keySet(); return ImmutableSet.copyOf(keys); } }  boolean isReservedChannel(String channel); void registerOutgoingPluginChannel(Plugin plugin, String channel); void unregisterOutgoingPluginChannel(Plugin plugin, String channel); void unregisterOutgoingPluginChannel(Plugin plugin); PluginMessageListenerRegistration registerIncomingPluginChannel(Plugin plugin, String channel, PluginMessageListener listener); void unregisterIncomingPluginChannel(Plugin plugin, String channel, PluginMessageListener listener); void unregisterIncomingPluginChannel(Plugin plugin, String channel); void unregisterIncomingPluginChannel(Plugin plugin); Set<String> getOutgoingChannels(); Set<String> getOutgoingChannels(Plugin plugin); Set<String> getIncomingChannels(); Set<String> getIncomingChannels(Plugin plugin); Set<PluginMessageListenerRegistration> getIncomingChannelRegistrations(Plugin plugin); Set<PluginMessageListenerRegistration> getIncomingChannelRegistrations(String channel); Set<PluginMessageListenerRegistration> getIncomingChannelRegistrations(Plugin plugin, String channel); boolean isRegistrationValid(PluginMessageListenerRegistration registration); boolean isIncomingChannelRegistered(Plugin plugin, String channel); boolean isOutgoingChannelRegistered(Plugin plugin, String channel); void dispatchIncomingMessage(Player source, String channel, byte[] message); static void validateChannel(String channel); static void validatePluginMessage(Messenger messenger, Plugin source, String channel, byte[] message);  }
@Test public void testGetOutgoingChannels() { Messenger messenger = getMessenger(); TestPlugin plugin1 = getPlugin(); TestPlugin plugin2 = getPlugin(); assertEquals(messenger.getOutgoingChannels()); messenger.registerOutgoingPluginChannel(plugin1, "foo"); messenger.registerOutgoingPluginChannel(plugin1, "bar"); messenger.registerOutgoingPluginChannel(plugin2, "baz"); messenger.registerOutgoingPluginChannel(plugin2, "baz"); assertEquals(messenger.getOutgoingChannels(), "foo", "bar", "baz"); }