Production extends ArrayList<Symbol> { public int getNTSymbols() { int cnt = 0; for (Symbol o : this) { if(o.getType() == Enums.SymbolType.NTSymbol && !(o.getSymbolString().startsWith(Constants.GE_CODON_VALUE_PARSING))) { cnt++; } } return cnt; } Production(int newLength);  Production();  Production(Production copy); boolean getRecursive(); void setRecursive(boolean newRecursive); int getMinimumDepth(); void setMinimumDepth(int newMinimumDepth); int getNTSymbols(); @Override @SuppressWarnings({"ForLoopReplaceableByForEach"}) String toString();  }
@Test public void testGetNTSymbols() { System.out.println("* ProductionTest: getNTSymbols"); Production instance = new Production(); instance.add(new Symbol("test", Enums.SymbolType.NTSymbol)); instance.add(new Symbol("test", Enums.SymbolType.TSymbol)); instance.add(new Symbol("test", Enums.SymbolType.NTSymbol)); instance.add(new Symbol(Constants.GE_CODON_VALUE_PARSING,Enums.SymbolType.NTSymbol)); int expResult = 2; int result = instance.getNTSymbols(); assertEquals(expResult, result); instance.clear(); assertEquals(0, instance.getNTSymbols()); }