Attribute id = SQL.parseAttribute("TABLE.ID");
db.setNullable(id, false);
NodeMaker x = new TypedNodeMaker(TypedNodeMaker.PLAIN_LITERAL, new Column(id), true);
Map<Var,NodeMaker> map = Collections.singletonMap(Var.alloc("x"), x);
BindingMaker bm = new BindingMaker(map, null);
RelationBuilder b1 = new RelationBuilder(db);
RelationBuilder b2 = new RelationBuilder(db);
b1.addProjection(id);
b2.addProjection(id);
b1.addCondition("TABLE.VALUE=1");
b2.addCondition("TABLE.VALUE=2");
CompatibleRelationGroup group = new CompatibleRelationGroup();
Relation r1 = b1.buildRelation();
Relation r2 = b2.buildRelation();
group.addBindingMaker(r1, bm);
assertTrue(group.isCompatible(r2));
group.addBindingMaker(r2, bm);
assertEquals(2, group.bindingMakers().size());