Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void assertUnchanged() {
- Verify.assertSize(2, this.set);
- Verify.assertContainsAll(this.set, "1", "2");
- Verify.assertNotContains("3", this.set);
- }
- @Test
- public void addDuplicate() {
- try {
- this.set.add("1");
- Assert.fail("Cannot add to DoubletonSet");
- } catch (UnsupportedOperationException ignored) {
- this.assertUnchanged();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment