Skip to content

Commit

Permalink
return -1 and tesT
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Balogh committed Mar 27, 2019
1 parent a8bd585 commit ea908f8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public long delay(T element) {
next = next.next;
}
if (next == null) {
return 0;
return -1;
}
return ret;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,11 @@ public void testReturnsFalseIfElementAlreadyRemoved() {

assertFalse(deltaQueue.remove(elementC));
}

public void testDelayIsMinusOneWhenElementIsAlreadyRemoved() {
deltaQueue.add(1L, elementA);
deltaQueue.remove(elementA);

assertEquals("delay", -1, deltaQueue.delay(elementA));
}
}

0 comments on commit ea908f8

Please sign in to comment.