Phenotype extends ArrayList<Symbol> { public String getStringNoSpace() { Symbol currentSymbol; StringBuilder S = new StringBuilder(); for (Object o : this) { currentSymbol = (Symbol)o; S.append(currentSymbol.getSymbolString()); } return S.toString(); } Phenotype();  Phenotype(Phenotype p); String getString(); String getStringNoSpace(); @Override String toString();  }
@Test public void testGetStringNoSpace() { System.out.println("PhenotypeTest: getStringNoSpace"); Phenotype instance = new Phenotype(); String result = instance.getStringNoSpace(); instance = new Phenotype(); instance.add(new Symbol("a",Enums.SymbolType.TSymbol)); instance.add(new Symbol("b", Enums.SymbolType.TSymbol)); result = "ab"; String expResult = instance.getString(); assertEquals(true, instance.getStringNoSpace().equals(result)); }