@Test public void testAdd() { SRTInfo srtInfo = new SRTInfo(); Date d = new Date(); srtInfo.add(new SRT(2, d, d, "Hello", "World")); srtInfo.add(new SRT(1, d, d, "Foo", "Bar")); srtInfo.add(new SRT(2, d, d, "Bye", "World")); assertEquals(2, srtInfo.size()); Iterator<SRT> iter = srtInfo.iterator(); SRT srt = iter.next(); assertEquals(1, srt.number); assertEquals(SRTTimeFormat.format(d), SRTTimeFormat.format(srt.startTime)); assertEquals(SRTTimeFormat.format(d), SRTTimeFormat.format(srt.endTime)); assertEquals("Foo Bar", StringUtils.join(srt.text, " ")); srt = iter.next(); assertEquals(2, srt.number); assertEquals(SRTTimeFormat.format(d), SRTTimeFormat.format(srt.startTime)); assertEquals(SRTTimeFormat.format(d), SRTTimeFormat.format(srt.endTime)); assertEquals("Bye World", StringUtils.join(srt.text, " ")); assertFalse(iter.hasNext()); }
public void add(SRT srt) { remove(srt); info.add(srt); }
SRTInfo implements Iterable<SRT>, Cloneable { public void add(SRT srt) { remove(srt); info.add(srt); } }
SRTInfo implements Iterable<SRT>, Cloneable { public void add(SRT srt) { remove(srt); info.add(srt); } SRTInfo();  SRTInfo(SRTInfo srtInfo); }
SRTInfo implements Iterable<SRT>, Cloneable { public void add(SRT srt) { remove(srt); info.add(srt); } SRTInfo();  SRTInfo(SRTInfo srtInfo); void add(SRT srt); Iterator<SRT> iterator(); int size(); void remove(SRT srt); void remove(int number); SRT get(int number); SRT get(SRT srt); boolean contains(int number); boolean contains(SRT srt); @Override Object clone(); }
SRTInfo implements Iterable<SRT>, Cloneable { public void add(SRT srt) { remove(srt); info.add(srt); } SRTInfo();  SRTInfo(SRTInfo srtInfo); void add(SRT srt); Iterator<SRT> iterator(); int size(); void remove(SRT srt); void remove(int number); SRT get(int number); SRT get(SRT srt); boolean contains(int number); boolean contains(SRT srt); @Override Object clone();  }