MutablePermissions extends AbstractSet<Permission> implements Permissions { @Override public boolean contains(final Permission permission, final Permission... furtherPermissions) { checkNotNull(permission, "permission whose presence is to be checked"); checkNotNull(furtherPermissions, "further permissions whose presence are to be checked"); return values.containsAll(EnumSet.of(permission, furtherPermissions)); } MutablePermissions(final Set<Permission> permissions);  MutablePermissions(final Collection<Permission> permissions); static Permissions none(); static Permissions all(); static Permissions of(final Permission permission, final Permission... furtherPermissions); @Override boolean contains(final Permission permission, final Permission... furtherPermissions); @Override boolean add(final Permission permission); @Override Iterator<Permission> iterator(); @Override int size(); @Override JsonObject toJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate); @Override JsonObject toJson(final JsonPointer pointer);  }
@Test public void containsWorksAsExpected() { underTest = Permissions.newInstance(Permission.READ, Permission.WRITE); assertThat(underTest.contains(Permission.READ)).isTrue(); assertThat(underTest.contains(Permission.WRITE)).isTrue(); assertThat(underTest.contains(Permission.ADMINISTRATE)).isFalse(); assertThat(underTest.contains(Permission.READ, Permission.WRITE)).isTrue(); assertThat(underTest.contains(Permission.READ, Permission.ADMINISTRATE)).isFalse(); assertThat(underTest.contains(Permission.WRITE, Permission.ADMINISTRATE)).isFalse(); underTest = Permissions.newInstance(Permission.READ, Permission.WRITE, Permission.ADMINISTRATE); assertThat(underTest.contains(Permission.READ, Permission.ADMINISTRATE)).isTrue(); }