@Test
public void testFilterAclEntriesByAclSpecAutomaticDefaultOther()
    throws AclException {

  List<AclEntry> existing = new ImmutableList.Builder<AclEntry>()
    .add(aclEntry(ACCESS, USER, ALL))
    .add(aclEntry(ACCESS, GROUP, READ))
    .add(aclEntry(ACCESS, OTHER, READ))
    .add(aclEntry(DEFAULT, USER, READ_WRITE))
    .add(aclEntry(DEFAULT, GROUP, READ_WRITE))
    .add(aclEntry(DEFAULT, OTHER, NONE))
    .build();
  List<AclEntry> aclSpec = Lists.newArrayList(
    aclEntry(DEFAULT, OTHER));
  List<AclEntry> expected = new ImmutableList.Builder<AclEntry>()
    .add(aclEntry(ACCESS, USER, ALL))
    .add(aclEntry(ACCESS, GROUP, READ))
    .add(aclEntry(ACCESS, OTHER, READ))
    .add(aclEntry(DEFAULT, USER, READ_WRITE))
    .add(aclEntry(DEFAULT, GROUP, READ_WRITE))
    .add(aclEntry(DEFAULT, OTHER, READ))
    .build();
  assertEquals(expected, filterAclEntriesByAclSpec(existing, aclSpec));
}