@Test public void testMoveAbove() throws Exception { }
public boolean moveAbove(ElementType objectToMove, ElementType reference) { if(objectToMove == reference) { throw new IllegalArgumentException("Illegal argument to moveAbove(A, B); A cannot be equal to B."); } list.remove(objectToMove); int refIndex = list.indexOf(reference); list.add(refIndex + 1, objectToMove); return true; }
ListOrganizer implements ZIndexable<ElementType> { public boolean moveAbove(ElementType objectToMove, ElementType reference) { if(objectToMove == reference) { throw new IllegalArgumentException("Illegal argument to moveAbove(A, B); A cannot be equal to B."); } list.remove(objectToMove); int refIndex = list.indexOf(reference); list.add(refIndex + 1, objectToMove); return true; } }
ListOrganizer implements ZIndexable<ElementType> { public boolean moveAbove(ElementType objectToMove, ElementType reference) { if(objectToMove == reference) { throw new IllegalArgumentException("Illegal argument to moveAbove(A, B); A cannot be equal to B."); } list.remove(objectToMove); int refIndex = list.indexOf(reference); list.add(refIndex + 1, objectToMove); return true; } ListOrganizer(List<ElementType> list); }
ListOrganizer implements ZIndexable<ElementType> { public boolean moveAbove(ElementType objectToMove, ElementType reference) { if(objectToMove == reference) { throw new IllegalArgumentException("Illegal argument to moveAbove(A, B); A cannot be equal to B."); } list.remove(objectToMove); int refIndex = list.indexOf(reference); list.add(refIndex + 1, objectToMove); return true; } ListOrganizer(List<ElementType> list); boolean moveToTop(ElementType element); boolean moveAbove(ElementType objectToMove, ElementType reference); boolean moveBeneath(ElementType objectToMove, ElementType reference); boolean moveToBottom(ElementType key); boolean moveUp(ElementType key); boolean moveDown(ElementType key); @Override List<ElementType> elements(); void addToBottom(ElementType element); void addToTop(ElementType element); }
ListOrganizer implements ZIndexable<ElementType> { public boolean moveAbove(ElementType objectToMove, ElementType reference) { if(objectToMove == reference) { throw new IllegalArgumentException("Illegal argument to moveAbove(A, B); A cannot be equal to B."); } list.remove(objectToMove); int refIndex = list.indexOf(reference); list.add(refIndex + 1, objectToMove); return true; } ListOrganizer(List<ElementType> list); boolean moveToTop(ElementType element); boolean moveAbove(ElementType objectToMove, ElementType reference); boolean moveBeneath(ElementType objectToMove, ElementType reference); boolean moveToBottom(ElementType key); boolean moveUp(ElementType key); boolean moveDown(ElementType key); @Override List<ElementType> elements(); void addToBottom(ElementType element); void addToTop(ElementType element);  }