FormatRegistrationService { public Stream<ExportFormat> getExternalFormats() { return types.stream().filter(format -> !INTERNAL_TYPES.contains(format.getName())); } FormatRegistrationService(List<ExportFormat> types); Stream<ExportFormat> getExternalFormats(); ExportFormat getByName(String formatName);  }
@Test public void shouldListOnlyExternalFormats() { final Stream<ExportFormat> externalFormats = service.getExternalFormats(); externalFormats.forEach(format -> Assert.assertFalse(StringUtils.equals(JsonFormat.JSON, format.getName()))); }