@Test public void createCategoriesListCreatesCorrectCategoryRepresentations() { final List<String> categoryNames = Arrays.asList(CATEGORY_1_NAME, CATEGORY_2_NAME); final List<Category> categories = this.component.createCategoriesRepresentation(categoryNames, this.autolinker, null); Assert.assertEquals(2, categories.size()); Assert.assertEquals(CATEGORY_1_NAME, categories.get(0).getCategory()); Assert.assertNull(categories.get(0).getVocabularies()); Assert.assertEquals(CATEGORY_2_NAME, categories.get(1).getCategory()); Assert.assertNull(categories.get(1).getVocabularies()); }
@Override public List<Category> createCategoriesRepresentation( final Collection<String> categoryIds, final Autolinker linker, final Function<String, List<org.phenotips.vocabularies.rest.model.Vocabulary>> vocabularySupplier) { return categoryIds.stream() .map(categoryId -> createLinkedCategoryRepresentation(categoryId, linker, vocabularySupplier)) .collect(Collectors.toList()); }
DefaultDomainObjectFactory implements DomainObjectFactory { @Override public List<Category> createCategoriesRepresentation( final Collection<String> categoryIds, final Autolinker linker, final Function<String, List<org.phenotips.vocabularies.rest.model.Vocabulary>> vocabularySupplier) { return categoryIds.stream() .map(categoryId -> createLinkedCategoryRepresentation(categoryId, linker, vocabularySupplier)) .collect(Collectors.toList()); } }
DefaultDomainObjectFactory implements DomainObjectFactory { @Override public List<Category> createCategoriesRepresentation( final Collection<String> categoryIds, final Autolinker linker, final Function<String, List<org.phenotips.vocabularies.rest.model.Vocabulary>> vocabularySupplier) { return categoryIds.stream() .map(categoryId -> createLinkedCategoryRepresentation(categoryId, linker, vocabularySupplier)) .collect(Collectors.toList()); }  }
DefaultDomainObjectFactory implements DomainObjectFactory { @Override public List<Category> createCategoriesRepresentation( final Collection<String> categoryIds, final Autolinker linker, final Function<String, List<org.phenotips.vocabularies.rest.model.Vocabulary>> vocabularySupplier) { return categoryIds.stream() .map(categoryId -> createLinkedCategoryRepresentation(categoryId, linker, vocabularySupplier)) .collect(Collectors.toList()); }  @Override org.phenotips.vocabularies.rest.model.Vocabulary createVocabularyRepresentation(Vocabulary vocabulary); @Override List<org.phenotips.vocabularies.rest.model.Vocabulary> createVocabulariesRepresentation(
        final Collection<Vocabulary> vocabularies,
        final Autolinker linker,
        final Function<Vocabulary, List<org.phenotips.vocabularies.rest.model.Category>> categorySupplier); @Override org.phenotips.vocabularies.rest.model.Vocabulary createLinkedVocabularyRepresentation(
        final Vocabulary vocabulary,
        final Autolinker linker,
        final Function<Vocabulary, List<org.phenotips.vocabularies.rest.model.Category>> categorySupplier); @Override org.phenotips.vocabularies.rest.model.Category createCategoryRepresentation(final String categoryId); @Override List<Category> createCategoriesRepresentation(
        final Collection<String> categoryIds,
        final Autolinker linker,
        final Function<String, List<org.phenotips.vocabularies.rest.model.Vocabulary>> vocabularySupplier); @Override org.phenotips.vocabularies.rest.model.Category createLinkedCategoryRepresentation(
        final String categoryId,
        final Autolinker linker,
        final Function<String, List<org.phenotips.vocabularies.rest.model.Vocabulary>> vocabularySupplier); }
DefaultDomainObjectFactory implements DomainObjectFactory { @Override public List<Category> createCategoriesRepresentation( final Collection<String> categoryIds, final Autolinker linker, final Function<String, List<org.phenotips.vocabularies.rest.model.Vocabulary>> vocabularySupplier) { return categoryIds.stream() .map(categoryId -> createLinkedCategoryRepresentation(categoryId, linker, vocabularySupplier)) .collect(Collectors.toList()); }  @Override org.phenotips.vocabularies.rest.model.Vocabulary createVocabularyRepresentation(Vocabulary vocabulary); @Override List<org.phenotips.vocabularies.rest.model.Vocabulary> createVocabulariesRepresentation(
        final Collection<Vocabulary> vocabularies,
        final Autolinker linker,
        final Function<Vocabulary, List<org.phenotips.vocabularies.rest.model.Category>> categorySupplier); @Override org.phenotips.vocabularies.rest.model.Vocabulary createLinkedVocabularyRepresentation(
        final Vocabulary vocabulary,
        final Autolinker linker,
        final Function<Vocabulary, List<org.phenotips.vocabularies.rest.model.Category>> categorySupplier); @Override org.phenotips.vocabularies.rest.model.Category createCategoryRepresentation(final String categoryId); @Override List<Category> createCategoriesRepresentation(
        final Collection<String> categoryIds,
        final Autolinker linker,
        final Function<String, List<org.phenotips.vocabularies.rest.model.Vocabulary>> vocabularySupplier); @Override org.phenotips.vocabularies.rest.model.Category createLinkedCategoryRepresentation(
        final String categoryId,
        final Autolinker linker,
        final Function<String, List<org.phenotips.vocabularies.rest.model.Vocabulary>> vocabularySupplier);  }