BaseCommands implements CommandMarker { protected void okOrShowErrors(Set<String> errors) { if (!errors.isEmpty()) { error(joinLines(errors)); } else { ok(); } }    }
@Test public void testOkOrShowError() { mockBaseCommands.okOrShowErrors(Collections.emptySet()); assertThat(logger.getOkMessages(), contains("OK")); mockBaseCommands.okOrShowErrors(new HashSet<>(Arrays.asList("one", "two"))); assertThat(logger.getErrorMessages(), contains("one\ntwo")); }