Part left = new Part("firstname", Person.class);
Part right = new Part("lastname", Person.class);
Iterator<Integer> indexes = Arrays.asList(1, 2).iterator();
Predicates predicate = Predicates.create(left, indexes);
predicate = predicate.and(new AtomicPredicate(right, indexes));
assertThat(predicate.toString(null), is("x.firstname = $1 AND x.lastname = $2"));
}