@Test public void andConjunctionTest() { CNFElement or1 = new CNFElement(); CNFElement or2 = new CNFElement(); CNF and1 = new CNF(); and1.addPredicate(or1); CNF and2 = new CNF(); and2.addPredicate(or2); ArrayList<CNFElement> reference = new ArrayList<>(); reference.add(or1); assertEquals(reference, and1.and(and2).and(and1).getPredicates()); }
public CNF and(CNF other) { other.getPredicates().stream() .filter(predicate -> !this.predicates.contains(predicate)) .forEach(this::addPredicate); return this; }
CNF extends PredicateCollection<CNFElement> { public CNF and(CNF other) { other.getPredicates().stream() .filter(predicate -> !this.predicates.contains(predicate)) .forEach(this::addPredicate); return this; } }
CNF extends PredicateCollection<CNFElement> { public CNF and(CNF other) { other.getPredicates().stream() .filter(predicate -> !this.predicates.contains(predicate)) .forEach(this::addPredicate); return this; } CNF();  CNF(List<CNFElement> predicates);  CNF(CNF copyValue); }
CNF extends PredicateCollection<CNFElement> { public CNF and(CNF other) { other.getPredicates().stream() .filter(predicate -> !this.predicates.contains(predicate)) .forEach(this::addPredicate); return this; } CNF();  CNF(List<CNFElement> predicates);  CNF(CNF copyValue); CNF and(CNF other); CNF or(CNF other); @Override boolean evaluate(Embedding embedding, EmbeddingMetaData metaData); @Override boolean evaluate(GraphElement graphElement); @Override String operatorName(); CNF getSubCNF(String variable); CNF getSubCNF(Set<String> variables); CNF removeSubCNF(String variable); CNF removeSubCNF(Set<String> variables); @Override Set<String> getVariables(); @Override Set<String> getPropertyKeys(String variable); }
CNF extends PredicateCollection<CNFElement> { public CNF and(CNF other) { other.getPredicates().stream() .filter(predicate -> !this.predicates.contains(predicate)) .forEach(this::addPredicate); return this; } CNF();  CNF(List<CNFElement> predicates);  CNF(CNF copyValue); CNF and(CNF other); CNF or(CNF other); @Override boolean evaluate(Embedding embedding, EmbeddingMetaData metaData); @Override boolean evaluate(GraphElement graphElement); @Override String operatorName(); CNF getSubCNF(String variable); CNF getSubCNF(Set<String> variables); CNF removeSubCNF(String variable); CNF removeSubCNF(Set<String> variables); @Override Set<String> getVariables(); @Override Set<String> getPropertyKeys(String variable);  }