if (!("TypeCast".equals(type) || "IndexOf".equals(type) || "Substring".equals(type) || "Substring2".equals(type) || type.startsWith("Empty"))) {
if (!("TypeCast".equals(type) || "IndexOf".equals(type) || "Substring".equals(type) || "Substring2".equals(type) || type.startsWith("Empty") || type.startsWith("BagConstraint") || "LargeBagConstraint".equals(type))) {
    public void executeTest(String type) throws Exception {        Query q = (Query) queries.get(type);        Object expected = results.get(type);        if (expected instanceof Failure) {            try {                SqlGenerator.generate(q, 0, Integer.MAX_VALUE, getSchema(), db);                fail(type + " was expected to fail");            } catch (Exception e) {                assertEquals(type + " was expected to produce a particular exception", expected, new Failure(e));            }        } else {            String generated = SqlGenerator.generate(q, 0, Integer.MAX_VALUE, getSchema(), db);            if (expected instanceof String) {                assertEquals("", results.get(type), generated);            } else if (expected instanceof Collection) {                boolean hasEqual = false;                Iterator expectedIter = ((Collection) expected).iterator();                while ((!hasEqual) && expectedIter.hasNext()) {                    String expectedString = (String) expectedIter.next();                    hasEqual = expectedString.equals(generated);                }                assertTrue(generated, hasEqual);            } else {                assertTrue("No result found for " + type, false);            }            assertEquals(results2.get(type), SqlGenerator.findTableNames(q, getSchema()));            // TODO: extend sql so that it can represent these            if (!("TypeCast".equals(type) || "IndexOf".equals(type) || "Substring".equals(type) || "Substring2".equals(type) || type.startsWith("Empty"))) {                // And check that the SQL generated is high enough quality to be parsed by the optimiser.                org.intermine.sql.query.Query sql = new org.intermine.sql.query.Query(generated);            }        }    }