}
public void testGlobalGroupForwardsAndBackwardsRefs() throws Exception
{
SchemaBinding schema = bind("GlobalGroup.xsd");
ModelGroupBinding group2 = schema.getGroup(new QName(NS, "global2"));
assertNotNull(group2);
ModelGroupBinding group3 = schema.getGroup(new QName(NS, "global3"));
assertNotNull(group3);
ModelGroupBinding group4 = schema.getGroup(new QName(NS, "global4"));
assertNotNull(group4);
// Forwards
Collection<ParticleBinding> particles = group2.getParticles();
assertNotNull(particles);
assertEquals(1, particles.size());
ParticleBinding particle = particles.iterator().next();
TermBinding term = particle.getTerm();
assertTrue(term == group3);
// Backwards
particles = group4.getParticles();
assertNotNull(particles);
assertEquals(1, particles.size());
particle = particles.iterator().next();
term = particle.getTerm();
assertTrue(term == group3);