elvyssoares

DoubletonSetTest - Original

May 19th, 2020
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.39 KB | None | 0 0
  1. private void assertUnchanged() {
  2.     Verify.assertSize(2, this.set);
  3.     Verify.assertContainsAll(this.set, "1", "2");
  4.     Verify.assertNotContains("3", this.set);
  5. }
  6.  
  7. @Test
  8. public void addDuplicate() {
  9.     try {
  10.         this.set.add("1");
  11.         Assert.fail("Cannot add to DoubletonSet");
  12.     } catch (UnsupportedOperationException ignored) {
  13.         this.assertUnchanged();
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment