class InMemoryConnector implements IncomingConnectorFactory, OutgoingConnectorFactory {

    public <T> InMemorySink<T> sink(String channel) {
        if (channel == null) {
            throw ex.illegalArgumentChannelMustNotBeNull();
        }
        InMemorySink<?> sink = sinks.get(channel);
        if (sink == null) {
            throw ex.illegalArgumentUnknownChannel(channel);
        }
        //noinspection unchecked
        return (InMemorySink<T>) sink;
    }

}