ImmutablePermissions extends AbstractSet<String> implements Permissions { @Override public JsonArray toJson() { final JsonArrayBuilder jsonArrayBuilder = JsonFactory.newArrayBuilder(); permissions.forEach(jsonArrayBuilder::add); return jsonArrayBuilder.build(); } private  ImmutablePermissions(final Set<String> permissions); static Permissions none(); static Permissions of(final String permission, final String... furtherPermissions); static Permissions of(final Collection<String> permissions); @Override boolean contains(final String permission, final String... furtherPermissions); @Override boolean contains(final Permissions permissions); @Override int size(); @Override JsonArray toJson(); @Nonnull @Override Iterator<String> iterator(); @Override boolean add(final String e); @Override boolean remove(final Object o); @Override boolean addAll(@Nonnull final Collection<? extends String> coll); @Override boolean removeAll(@Nonnull final Collection<?> coll); @Override boolean retainAll(@Nonnull final Collection<?> coll); @Override void clear(); @Override boolean removeIf(final Predicate<? super String> filter);  }
@Test public void createJsonRepresentationOfEmptyMutablePermissions() { final JsonValue actualJsonValue = underTest.toJson(); assertThat(actualJsonValue).isEqualTo(JsonArray.newBuilder().build()); }