public void test() {
      ReadAllQuery query = new ReadAllQuery();
      query.setReferenceClass(Employee.class);
      setSelectionCriteria(query);

      ReadAllQuery controlQuery = (ReadAllQuery) query.clone();

      Expression employees = query.getExpressionBuilder().anyOf("managedEmployees");
      query.addJoinedAttribute(employees);
      Expression phones = employees.anyOf("phoneNumbers");
      query.addJoinedAttribute(phones);

      String errorMsg =
          JoinedAttributeTestHelper.executeQueriesAndCompareResults(
              controlQuery, query, (AbstractSession) getSession());
      if (errorMsg.length() > 0) {
        throw new TestErrorException(errorMsg);
      }
    }
 protected String executeQueriesAndCompareResults(
     ObjectLevelReadQuery controlQuery, ObjectLevelReadQuery queryWithJoins) {
   return JoinedAttributeTestHelper.executeQueriesAndCompareResults(
       controlQuery, queryWithJoins, (AbstractSession) getDbSession());
 }