@Test public void testCopy() { Sequence[] copies = { new Sequence(sequenceABC), sequenceABC.copy() }; for(Sequence sequenceABCD : copies) { assertEquals(3, sequenceABCD.size()); assertEquals(sequenceABC, sequenceABCD); sequenceABCD.add(d); assertEquals(4, sequenceABCD.size()); assertEquals(3, sequenceABC.size()); assertFalse(sequenceABC.equals(sequenceABCD)); } }
public Sequence copy() { Sequence ret = new Sequence(size()); for(Symbol s : this) { ret.add(s); } return ret; }
Sequence extends ArrayList<Symbol> implements AbstractSequence { public Sequence copy() { Sequence ret = new Sequence(size()); for(Symbol s : this) { ret.add(s); } return ret; } }
Sequence extends ArrayList<Symbol> implements AbstractSequence { public Sequence copy() { Sequence ret = new Sequence(size()); for(Symbol s : this) { ret.add(s); } return ret; } Sequence(int size);  Sequence();  Sequence(ArrayList<Symbol> symbols); }
Sequence extends ArrayList<Symbol> implements AbstractSequence { public Sequence copy() { Sequence ret = new Sequence(size()); for(Symbol s : this) { ret.add(s); } return ret; } Sequence(int size);  Sequence();  Sequence(ArrayList<Symbol> symbols); String toString(); String toDotString(); Sequence copy(); static void printSequenceArray(Sequence[] arr); @Override int dotLength(); @Override void getImpl(StringBuilder sb, Map<Symbol, Integer> symToNum); }
Sequence extends ArrayList<Symbol> implements AbstractSequence { public Sequence copy() { Sequence ret = new Sequence(size()); for(Symbol s : this) { ret.add(s); } return ret; } Sequence(int size);  Sequence();  Sequence(ArrayList<Symbol> symbols); String toString(); String toDotString(); Sequence copy(); static void printSequenceArray(Sequence[] arr); @Override int dotLength(); @Override void getImpl(StringBuilder sb, Map<Symbol, Integer> symToNum);  }