QueryAttrMulti extends QueryAttr { @Override public String toString() { return getName() + parts.toString(); } QueryAttrMulti(String name, QueryAttr... parts);  QueryAttrMulti(String name, String title, QueryAttr... parts); QueryAttrMulti orCombined(); QueryAttrMulti andCombined(); List<QueryAttr> getParts(); boolean isOrCombined(); @Override String toString();  }
@Test public void findUsingCompOpLike() { QueryExprCompare expr = new QueryExprCompare(nameOrDescrAttr, CompOpLike.class, "%likes%"); assertEquals("[Erwin]", findItems(queryService, expr, 100).toString());; expr = new QueryExprCompare(nameOrDescrAttr, CompOpLike.class, "Anna%"); assertEquals("[Anna]", findItems(queryService, expr, 100).toString());; expr = new QueryExprCompare(nameOrDescrAttr, CompOpLike.class, "%Anna%"); assertEquals("[Anna, Erwin]", findItems(queryService, expr, 100).toString());; expr = new QueryExprCompare(nameOrDescrAttr, CompOpLike.class, "%in%"); assertEquals("[Anna, Erwin, Hugo]", findItems(queryService, expr, 100).toString());; }
@Test public void findUsingCompOpIn() { QueryExprCompare expr = new QueryExprCompare(nameOrDescrAttr, CompOpIn.class, Arrays.asList("Hugo")); assertEquals("[Hugo]", findItems(queryService, expr, 100).toString());; expr = new QueryExprCompare(nameOrDescrAttr, CompOpIn.class, Arrays.asList("Max", "Erwin")); assertEquals("[Erwin, Hugo, Max]", findItems(queryService, expr, 100).toString());; }