### Question:
Production { public boolean containsOneNonTerminal() { if (getHandle().size() == 1) { return handle.get(0).getType().equals(SymbolType.NON_TERMINAL); } return false; } Production(Symbol head, int tableIndex); Symbol getHead(); SymbolList getHandle(); int getTableIndex(); void setHead(Symbol head); void setHandle(SymbolList handle); void setTableIndex(int tableIndex); boolean containsOneNonTerminal(); @Override String toString();  }### Answer:
@Test public void testContainsOneNonTerminal() { Production production = new Production(new Symbol(), 2); assertFalse("null list", production.containsOneNonTerminal()); production.setHandle(new SymbolList()); assertFalse("empty list", production.containsOneNonTerminal()); production.getHandle().clear(); production.getHandle().add(new Symbol("Symbol1", SymbolType.NOISE, 1)); assertFalse("one terminal symbol", production.containsOneNonTerminal()); production.getHandle().clear(); production.getHandle().add(new Symbol("Symbol1", SymbolType.NON_TERMINAL, 1)); assertTrue("one non-terminal", production.containsOneNonTerminal()); production.getHandle().add(new Symbol("Symbol2", SymbolType.NON_TERMINAL, 2)); assertFalse("two non-terminals", production.containsOneNonTerminal()); production.getHandle().clear(); production.getHandle().add(new Symbol("Symbol1", SymbolType.NON_TERMINAL, 1)); assertTrue("one non-terminal", production.containsOneNonTerminal()); production.getHandle().add(new Symbol("Symbol2", SymbolType.NOISE, 2)); assertFalse("one terminal/one non-terminal", production.containsOneNonTerminal()); }