check( new Cluster("(Transaction << Book) >> Author_books, Author").restriction(0, "Transaction.book", "Book.id").fields("Transaction.id").select().list().equals(list(1l, 1l, 1l)) );
Cluster cluster1 = new Cluster("Transaction << Book", list("Book.title"));
check( cluster1.select().distinct("Book.title").order("Book.title").list().equals(list("The Dark Tower", "The Shining")) );
check( cluster1.select().distinct("Book.title").order("Book.title", "DESC").page(0, 2).list().equals(list("The Shining", "The Dark Tower")));
check( cluster1.select().distinct("Book.title").order("Book.title", "DESC").page(0, 1).list().equals(list("The Shining")));
check( cluster1.<Long>max("Book.id") == 2l);
check( cluster1.<Long>min("Transaction.id") == 1l);
check( cluster1.<Double>avg("Transaction.id") == 2.0);
check( cluster1.<Long>sum("Transaction.id") == 6);
check( cluster1.count() == 3);
check( cluster1.count("Book.id") == 3);