@Test public void applyShouldUnionFlaggedKeyword() { KeywordsCombiner keywordsCombiner = new KeywordsCombiner(); assertThat(keywordsCombiner.apply( Keywords.DEFAULT_VALUE, KEYWORDS_FACTORY.from(Keyword.FLAGGED))) .isEqualTo(KEYWORDS_FACTORY.from(Keyword.FLAGGED)); }
@Override public Keywords apply(Keywords keywords, Keywords keywords2) { return keywordsFactory .fromSet(Sets.union( union(keywords.getKeywords(), keywords2.getKeywords(), KEYWORD_NOT_TO_UNION), intersect(keywords.getKeywords(), keywords2.getKeywords(), KEYWORD_TO_INTERSECT))); }
KeywordsCombiner implements BinaryOperator<Keywords> { @Override public Keywords apply(Keywords keywords, Keywords keywords2) { return keywordsFactory .fromSet(Sets.union( union(keywords.getKeywords(), keywords2.getKeywords(), KEYWORD_NOT_TO_UNION), intersect(keywords.getKeywords(), keywords2.getKeywords(), KEYWORD_TO_INTERSECT))); } }
KeywordsCombiner implements BinaryOperator<Keywords> { @Override public Keywords apply(Keywords keywords, Keywords keywords2) { return keywordsFactory .fromSet(Sets.union( union(keywords.getKeywords(), keywords2.getKeywords(), KEYWORD_NOT_TO_UNION), intersect(keywords.getKeywords(), keywords2.getKeywords(), KEYWORD_TO_INTERSECT))); } KeywordsCombiner(); }
KeywordsCombiner implements BinaryOperator<Keywords> { @Override public Keywords apply(Keywords keywords, Keywords keywords2) { return keywordsFactory .fromSet(Sets.union( union(keywords.getKeywords(), keywords2.getKeywords(), KEYWORD_NOT_TO_UNION), intersect(keywords.getKeywords(), keywords2.getKeywords(), KEYWORD_TO_INTERSECT))); } KeywordsCombiner(); @Override Keywords apply(Keywords keywords, Keywords keywords2); Set<Keyword> union(Set<Keyword> set1, Set<Keyword> set2, List<Keyword> exceptKeywords); Set<Keyword> intersect(Set<Keyword> set1, Set<Keyword> set2, List<Keyword> forKeywords); }
KeywordsCombiner implements BinaryOperator<Keywords> { @Override public Keywords apply(Keywords keywords, Keywords keywords2) { return keywordsFactory .fromSet(Sets.union( union(keywords.getKeywords(), keywords2.getKeywords(), KEYWORD_NOT_TO_UNION), intersect(keywords.getKeywords(), keywords2.getKeywords(), KEYWORD_TO_INTERSECT))); } KeywordsCombiner(); @Override Keywords apply(Keywords keywords, Keywords keywords2); Set<Keyword> union(Set<Keyword> set1, Set<Keyword> set2, List<Keyword> exceptKeywords); Set<Keyword> intersect(Set<Keyword> set1, Set<Keyword> set2, List<Keyword> forKeywords);  }