protected Set<MessageOutput> getMessageOutputsForStream(Stream stream) {
        Set<MessageOutput> result = new HashSet<>();
        for (Output output : stream.getOutputs()) {
            final MessageOutput messageOutput = outputRegistry.getOutputForIdAndStream(output.getId(), stream);
            if (messageOutput != null) {
                result.add(messageOutput);
            }
        }

        return result;
    }
@Test
    public void testGetMessageOutputsForSingleStream() throws Exception {
        final Stream stream = mock(Stream.class);
        final Output output = mock(Output.class);
        final String outputId = "foobar";
        final MessageOutput messageOutput = mock(MessageOutput.class);
        final Set<Output> outputSet = ImmutableSet.of(output);
        when(stream.getOutputs()).thenReturn(outputSet);
        when(output.getId()).thenReturn(outputId);
        when(outputRegistry.getOutputForIdAndStream(eq(outputId), eq(stream))).thenReturn(messageOutput);
        final OutputRouter outputRouter = new OutputRouter(defaultMessageOutput, outputRegistry);

        final Collection<MessageOutput> messageOutputs = outputRouter.getMessageOutputsForStream(stream);

        assertEquals(1, messageOutputs.size());
        assertTrue(messageOutputs.contains(messageOutput));
    }