@Test
public void testCollectionAll() throws Exception {

  Privilege collectionAll = create(new KeyValue("collection", ALL));
  Privilege collection1 = create(new KeyValue("collection", "coll1"));
  assertTrue(collectionAll.implies(collection1));
  assertTrue(collection1.implies(collectionAll));
  Privilege allUpdate =
    create(new KeyValue("collection", ALL), new KeyValue("action", "update"));
  Privilege allQuery =
    create(new KeyValue("collection", ALL), new KeyValue("action", "query"));
  Privilege coll1Update =
    create(new KeyValue("collection", "coll1"), new KeyValue("action", "update"));
  Privilege coll1Query =
    create(new KeyValue("collection", "coll1"), new KeyValue("action", "query"));
  assertTrue(allUpdate.implies(coll1Update));
  assertTrue(allQuery.implies(coll1Query));
  assertTrue(coll1Update.implies(allUpdate));
  assertTrue(coll1Query.implies(allQuery));
  assertFalse(allUpdate.implies(coll1Query));
  assertFalse(coll1Update.implies(coll1Query));
  assertFalse(allQuery.implies(coll1Update));
  assertFalse(coll1Query.implies(allUpdate));
  assertFalse(allUpdate.implies(allQuery));
  assertFalse(allQuery.implies(allUpdate));
  assertFalse(coll1Update.implies(coll1Query));
  assertFalse(coll1Query.implies(coll1Update));
  // test different length paths
  assertTrue(collectionAll.implies(allUpdate));
  assertTrue(collectionAll.implies(allQuery));
  assertTrue(collectionAll.implies(coll1Update));
  assertTrue(collectionAll.implies(coll1Query));
  assertFalse(allUpdate.implies(collectionAll));
  assertFalse(allQuery.implies(collectionAll));
  assertFalse(coll1Update.implies(collectionAll));
  assertFalse(coll1Query.implies(collectionAll));
}