### Question:
seq extends AbstractMaxRubyObject { public void delete(Atom[] args) { if (!seq.isEmpty()) { if (args.length == 0) { seq.clear(); } else { TreeSet<Integer> indices = new TreeSet<Integer>(new Comparator<Integer>() { public int compare(Integer o1, Integer o2) { return -o1.compareTo(o2); } }); for (Atom arg : args) { if (Utils.isNumber(arg)) { int idx = fixBounds(arg.toInt()); if (idx >= 0) { indices.add(idx); } } } for (int idx : indices) { seq.remove(idx); if (idx < index) { index--; } } } outputseq(); onSeqChange(); } } seq(Atom[] args); List<Item> items(); Atom[] getseq(); @SuppressWarnings("all") void seq(Atom[] list); int getindex(); void index(int idx); int getiter(); void iter(int iter); int getstep(); void step(int s); String getchordmode(); void chordmode(String chordmode); void list(Atom[] list); void set(Atom[] list); void anything(String msg, Atom[] args); void text(Atom[] args); void rubyseq(Atom[] input); void ruby(Atom[] input); void append(Atom[] list); void prepend(Atom[] list); void insert(Atom[] args); void insertsort(Atom[] list); void repeat(Atom[] args); void length(Atom[] args); void delete(Atom[] args); void subseq(int left, int right); void deleterange(int left, int right); void deletevalue(Atom[] args); void sort(); void sortrange(int left, int right); void replace(Atom args[]); void replacerange(Atom args[]); void swap(Atom args[]); void reverse(); void reverserange(int idx1, int idx2); void rotate(int n); void rotaterange(int left, int right, int n); void add(Atom[] args); @Deprecated void addrange(Atom[] args); @Deprecated void addrevrange(Atom[] args); void multiply(Atom[] args); @Deprecated void multiplyrange(Atom[] args); @Deprecated void multiplyrevrange(Atom[] args); void invert(Atom[] args); void subtractfrom(Atom... args); void max(); Number getMax(); void min(); Number getMin(); void direction(); void direction(int dir); void advance(int n); void next(); void prev(); void bang(); void output(); void outputseq(); void reset(); void resetindex(); void resetiter(); void resetstep(); void resetcmode(); void resetseq(); boolean equals(Object obj); String toString();  }### Answer:
@Test public void testDelete() throws Exception { seqStub s = makeSeq(); s.delete(0); assertEquals(makeSeq("B", "C", "D", "E"), s); s.delete(-1); assertEquals(makeSeq("B", "C", "D"), s); s.delete(5); assertEquals(makeSeq("B", "C", "D"), s); s.delete(new int[] { 1, 3 }); assertEquals(makeSeq("B", "D"), s); s.delete(new int[] { 0, 1, 2, -1 }); assertEquals(emptySeq(), s); s.delete(0); s.delete(new int[] { 1, 2, 3 }); assertEquals(emptySeq(), s); }