query.setFilter("((name == aName) || (name == anotherName))");
Collection col = (Collection)
query.execute(POBuilder.names[1], POBuilder.names[2]);
Iterator iter = col.iterator();
Assert.assertTrue("The query result is empty", iter.hasNext());
Employee e1 = (Employee) iter.next();
Assert.assertNotNull("Null collection element 1", e1);
Assert.assertTrue("Only one element in the query result", iter.hasNext());
Employee e2 = (Employee) iter.next();
Assert.assertNotNull("Null collection element 2", e2);
Assert.assertTrue("More than one element in the query result", !iter.hasNext());
Assert.assertEquals("Bad query result size", 2, col.size());
query.close(col);
if (POBuilder.names[1].equals(e1.getName())) {
Assert.assertEquals("Bad employee name", POBuilder.names[2], e2.getName());
} else if (POBuilder.names[1].equals(e2.getName())) {
Assert.assertEquals("Bad employee name", POBuilder.names[2], e1.getName());
} else {
fail("Bad employee name");
}
} catch (JDOException e) {