### Question:
Rule { public Set<Symbol> getTerminals() { return terminals; } protected  Rule();  Rule(Sequence lhs, AbstractSequence rhs); Sequence getLhs(); AbstractSequence getRhs(); int getNumber(); Set<Symbol> getTerminals(); @Override String toString(); String toDotString(); int dotLength(); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test public void testTerminals() { assertTrue(ab_a.getTerminals().contains(a)); assertTrue(ab_a.getTerminals().contains(b)); assertFalse(ab_a.getTerminals().contains(c)); assertFalse(ab_a.getTerminals().contains(d)); assertTrue(ab_cd.getTerminals().contains(a)); assertTrue(ab_cd.getTerminals().contains(b)); assertTrue(ab_cd.getTerminals().contains(c)); assertTrue(ab_cd.getTerminals().contains(d)); }