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() {
- Throwable thrown = catchThrowable(() -> this.set.add("1"));
- assertThat(thrown).isInstanceOf(UnsupportedOperationException.class);
- this.assertUnchanged();
- }
Advertisement
Add Comment
Please, Sign In to add comment