BooleanTerm extends HashSet<BooleanVar> { public BooleanTerm resolveWith(Features features) { return resolveWith(features, false); } private  BooleanTerm();  BooleanTerm(BooleanVar var);  BooleanTerm(Set<BooleanVar> term);  BooleanTerm(String str); boolean isTrue(); boolean isFalse(); BooleanTerm resolveWith(Features features); BooleanTerm resolveWith(Features features, boolean coerceUndefinedToFalse); BooleanTerm andWith(BooleanTerm other); @Override String toString(); @Override boolean add(BooleanVar object); @Override void clear(); @Override boolean remove(Object object); @Override boolean removeAll(Collection<?> collection); @Override boolean addAll(Collection<? extends BooleanVar> collection); @Override boolean retainAll(Collection<?> collection); @Override int hashCode(); @Override boolean equals(Object other); static final BooleanTerm TRUE; static final BooleanTerm FALSE; }
@Test public void testResolveWith() { Features features = new Features(); features.put("A", true); features.put("B", true); assertEquals(BooleanTerm.TRUE, new BooleanTerm("A*B").resolveWith(features)); assertEquals(BooleanTerm.FALSE, new BooleanTerm("A*!B").resolveWith(features)); assertEquals(new BooleanTerm("C"), new BooleanTerm("A*B*C").resolveWith(features)); assertEquals(BooleanTerm.FALSE, new BooleanTerm("A*!B*C").resolveWith(features)); assertEquals(new BooleanTerm("A*B"), new BooleanTerm("A*B").resolveWith(new Features())); assertEquals(BooleanTerm.TRUE, BooleanTerm.TRUE.resolveWith(features)); assertEquals(BooleanTerm.TRUE, BooleanTerm.TRUE.resolveWith(features)); assertEquals(BooleanTerm.FALSE, BooleanTerm.FALSE.resolveWith(features)); }