### Question:
SymbolList extends ArrayList<Symbol> { public Symbol findByName(String name) { for (Symbol symbol : this) { if (symbol.name.equalsIgnoreCase(name)) { return symbol; } } return null; } SymbolList();  SymbolList(int size); Symbol findByName(String name); @Override String toString(); static final String SYMBOL_COMMENT; static final String SYMBOL_COMMENT_BLOCK; static final String SYMBOL_COMMENT_LINE; }### Answer:
@Test public void testFindByName() { SymbolList symbols = new SymbolList(); symbols.add(new Symbol("Symbol1", SymbolType.CONTENT, 1)); symbols.add(new Symbol("Symbol2", SymbolType.CONTENT, 2)); symbols.add(new Symbol("Symbol3", SymbolType.CONTENT, 3)); Symbol symbol; symbol = symbols.findByName(null); assertNull(symbol); symbol = symbols.findByName(""); assertNull(symbol); symbol = symbols.findByName("Symbol0"); assertNull(symbol); for (int i = 1; i <= 3; i++) { symbol = symbols.findByName("Symbol" + i); assertNotNull("should have found Symbol" + i, symbol); assertEquals("wrong symbol", "'Symbol" + i +"'", symbol.toString()); } }