@SuppressWarnings({"unchecked", "ResultOfMethodCallIgnored"}) @Test void testAddStreamExistingLanguages() { Language language0 = getMockLanguage(LANGUAGE_CODE_EN); Language language1 = getMockLanguage(LANGUAGE_CODE_NL); doAnswer( invocation -> { ((Stream<Language>) invocation.getArguments()[0]).collect(toList()); return 2; }) .when(delegateRepository) .add(any(Stream.class)); assertEquals(valueOf(2), languageRepositoryDecorator.add(of(language0, language1))); }
@Override public void add(Language language) { validateLanguage(language); delegate().add(language); }
LanguageRepositoryDecorator extends AbstractRepositoryDecorator<Language> { @Override public void add(Language language) { validateLanguage(language); delegate().add(language); } }
LanguageRepositoryDecorator extends AbstractRepositoryDecorator<Language> { @Override public void add(Language language) { validateLanguage(language); delegate().add(language); } LanguageRepositoryDecorator(Repository<Language> delegateRepository); }
LanguageRepositoryDecorator extends AbstractRepositoryDecorator<Language> { @Override public void add(Language language) { validateLanguage(language); delegate().add(language); } LanguageRepositoryDecorator(Repository<Language> delegateRepository); @Override void delete(Language language); @Override void delete(Stream<Language> entities); @Override void deleteById(Object id); @Override void deleteAll(Stream<Object> ids); @Override void deleteAll(); @Override void add(Language language); @Override Integer add(Stream<Language> languageStream); }
LanguageRepositoryDecorator extends AbstractRepositoryDecorator<Language> { @Override public void add(Language language) { validateLanguage(language); delegate().add(language); } LanguageRepositoryDecorator(Repository<Language> delegateRepository); @Override void delete(Language language); @Override void delete(Stream<Language> entities); @Override void deleteById(Object id); @Override void deleteAll(Stream<Object> ids); @Override void deleteAll(); @Override void add(Language language); @Override Integer add(Stream<Language> languageStream);  }