### Question:
FilterSQLEncoder extends FilterWalker<Object> { public String encode(Filter<?> filter, Object obj) { sql.clear(); args.clear(); filter.accept(this, obj); return sql.toString(); } FilterSQLEncoder(); void setPrimaryKey(PrimaryKey pkey); void setDbTypes(DbTypes dbtypes); void setSchema(Schema schema); SQL getSQL(); List<Pair<Object, Integer>> getArgs(); boolean isPrepared(); void setPrepared(boolean prepared); String encode(Filter<?> filter, Object obj); Object visit(Literal literal, Object obj); Object visit(Property property, Object obj); Object visit(Function function, Object obj); @Override Object visit(Mixed mixed, Object obj); @Override Object visit(Self self, Object obj); @Override Object visit(Expression expr, Object obj); final Object visit(All<?> all, Object obj); Object visit(None<?> none, Object obj); Object visit(Id<?> id, Object obj); Object visit(Logic<?> logic, Object obj); Object visit(Comparison<?> compare, Object obj); Object visit(Spatial<?> spatial, Object obj); @Override Object visit(Math math, Object obj); @Override Object visit(Like like, Object obj); @Override Object visit(In in, Object obj); @Override Object visit(Null isNull, Object obj);  }### Answer:
@Test public void testIn() throws Exception { Filter f = Filter.build().property("x").literal("six").literal(6).in().filter(); assertEquals("\"x\" IN ('six',6)", sqle.encode(f, null)); }
@Test public void testLike() throws Exception { Filter f = Filter.build().property("x").literal("foo%bar").like().filter(); assertEquals("\"x\" LIKE 'foo%bar'", sqle.encode(f, null)); }
@Test public void testMath() throws Exception { Filter f = Filter.build().property("x").literal(42).multiply().literal(2).eq().filter(); assertEquals("(\"x\"*?) = ?", sqle.encode(f, null)); }
@Test public void testNull() throws Exception { Filter f = Filter.build().property("x").isNull().property("y").isNotNull().or().filter(); assertEquals("(\"x\" IS NULL) OR (\"y\" IS NOT NULL)", sqle.encode(f, null)); }