### Question:
Rule { public boolean isUnary() { return rhs.size() == 1; } Rule(String lhs, StringTuple rhs);  Rule(String lhs, String rhs);  Rule(String lhs, String rhs, SemanticFunction semantics);  Rule(String lhs, StringTuple rhs, SemanticFunction semantics);  Rule(String lhs, String rhs, Map<String, Object> semantics);  Rule(String lhs, String rhs, String semantics); String getLHS(); StringTuple getRHS(); SemanticFunction getSemantics(); boolean isLexical(); boolean isUnary(); boolean isBinary(); boolean isCategorial(); boolean hasOptionals(); void validate(); boolean isCat(String label); boolean isOptional(String label); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test void isUnary() { Rule r1 = new Rule("$A", "B C D"); Rule r2 = new Rule("$A", "B C $D"); Rule r3 = new Rule("$A", "B"); Rule r4 = new Rule("$A", "$B"); assertFalse(r1.isUnary()); assertFalse(r2.isUnary()); assertTrue(r3.isUnary()); assertTrue(r4.isUnary()); }