@Test(expected=AclException.class)
public void testReplaceAclEntriesResultTooLarge() throws AclException {

  List<AclEntry> existing = new ImmutableList.Builder<AclEntry>()
    .add(aclEntry(ACCESS, USER, ALL))
    .add(aclEntry(ACCESS, GROUP, READ))
    .add(aclEntry(ACCESS, OTHER, NONE))
    .build();
  List<AclEntry> aclSpec = Lists.newArrayListWithCapacity(32);
  aclSpec.add(aclEntry(ACCESS, USER, ALL));
  for (int i = 1; i <= 29; ++i) {
    aclSpec.add(aclEntry(ACCESS, USER, "user" + i, READ));
  }
  aclSpec.add(aclEntry(ACCESS, GROUP, READ));
  aclSpec.add(aclEntry(ACCESS, OTHER, NONE));
  // The ACL spec now has 32 entries.  Automatic mask calculation will push it
  // over the limit to 33.
  replaceAclEntries(existing, aclSpec);
}