@Test
public void createAccessControlListFromValidJson() {

  /*
   * Valid JSON string to be parsed:
   *
   *   {
   *      "ed420ff0-b1c96661e4-9070-3863bbc77d82": {
   *         "READ": true,
   *         "WRITE": true,
   *         "ADMINISTRATE": false
   *      },
   *      "edca04a0-b1c96661e4-9070-3863bbc77d82": {
   *         "READ": true,
   *         "WRITE": false,
   *         "ADMINISTRATE": false
   *      }
   *   }
   */
    final JsonObject jsonObject = JsonFactory.newObjectBuilder() //
            .set("ed420ff0-b1c96661e4-9070-3863bbc77d82",
                    JsonFactory.newObjectBuilder() //
                            .set(Permission.READ.toJsonKey(), true) //
                            .set(Permission.WRITE.toJsonKey(), true) //
                            .set(Permission.ADMINISTRATE.toJsonKey(), false) //
                            .build()) //
            .set("edca04a0-b1c96661e4-9070-3863bbc77d82",
                    JsonFactory.newObjectBuilder() //
                            .set(Permission.READ.toJsonKey(), true) //
                            .set(Permission.WRITE.toJsonKey(), false) //
                            .set(Permission.ADMINISTRATE.toJsonKey(), false) //
                            .build()) //
            .build();
    final AccessControlList underTest = ImmutableAccessControlList.fromJson(jsonObject);
    assertThat(underTest).containsOnly(
            toAclEntry("ed420ff0-b1c96661e4-9070-3863bbc77d82", Permission.READ, Permission.WRITE),
            toAclEntry("edca04a0-b1c96661e4-9070-3863bbc77d82", Permission.READ));
}