@SuppressWarnings("unchecked") // only cast after checking each element's type
  private static ImmutableList<AclEntry> toAcl(List<?> list) {
    ImmutableList<?> copy = ImmutableList.copyOf(list);
    for (Object obj : copy) {
      if (!(obj instanceof AclEntry)) {
        throw new IllegalArgumentException(
            "invalid element for attribute 'acl:acl': should be List<AclEntry>, "
                + "found element of type "
                + obj.getClass());
      }
    }

    return (ImmutableList<AclEntry>) copy;
  }
Attribute provider that provides the {@link AclFileAttributeView} ("acl").

@author Colin Decker
jimfs/src/main/java/com/google/common/jimfs/AclAttributeProvider.java