private Iterable<MutationResultListenerFactory> findListeners() { final Iterable<? extends MutationResultListenerFactory> listeners = this.plugins .findListeners(); final Collection<MutationResultListenerFactory> matches = FCollection .filter(listeners, nameMatches(this.options.getOutputFormats())); if (matches.size() < this.options.getOutputFormats().size()) { throw new PitError("Unknown listener requested in " + StringUtil.join(this.options.getOutputFormats(), ",")); } return matches; }
@Test public void shouldJoinStringWithSeparators() { assertEquals("foo,bar,car", StringUtil.join(Arrays.asList("foo", "bar", "car"), ",")); }
@Test public void shouldIncludeNoSeparatorsWhenJoiningSingleItem() { assertEquals("foo", StringUtil.join(Collections.singleton("foo"), ",")); }
@Test public void shouldCreateEmptyStringWhenJoiningEmptyList() { assertEquals("", StringUtil.join(Collections.<String> emptyList(), ",")); }