@Test public void testAdd(){ assertEquals(0, k.size()); k.add(testString); assertEquals(1,k.size()); }
public void add(String s){ Key newKey = new Key(s); if (head == null){ head = newKey; tail = newKey; } else { tail.setNext(newKey); newKey.setPrev(tail); tail = newKey; } size++; }
KeyBuffer { public void add(String s){ Key newKey = new Key(s); if (head == null){ head = newKey; tail = newKey; } else { tail.setNext(newKey); newKey.setPrev(tail); tail = newKey; } size++; } }
KeyBuffer { public void add(String s){ Key newKey = new Key(s); if (head == null){ head = newKey; tail = newKey; } else { tail.setNext(newKey); newKey.setPrev(tail); tail = newKey; } size++; } KeyBuffer(); }
KeyBuffer { public void add(String s){ Key newKey = new Key(s); if (head == null){ head = newKey; tail = newKey; } else { tail.setNext(newKey); newKey.setPrev(tail); tail = newKey; } size++; } KeyBuffer(); void add(String s); int size(); @Override String toString(); String drain(); void free(); }
KeyBuffer { public void add(String s){ Key newKey = new Key(s); if (head == null){ head = newKey; tail = newKey; } else { tail.setNext(newKey); newKey.setPrev(tail); tail = newKey; } size++; } KeyBuffer(); void add(String s); int size(); @Override String toString(); String drain(); void free();  }