### Question:
InheritedAclFactory implements AclFactory { @Override public List<RoleAssignment> getPatronRoleAssignments(PID pid) { return getRoleAssignments(pid, false); }  @Override Map<String, Set<String>> getPrincipalRoles(PID target); @Override List<RoleAssignment> getStaffRoleAssignments(PID pid); @Override List<RoleAssignment> getPatronRoleAssignments(PID pid); @Override List<RoleAssignment> getPatronAccess(PID pid); @Override Date getEmbargoUntil(PID target); @Override boolean isMarkedForDeletion(PID target); void setObjectAclFactory(ObjectAclFactory objectAclFactory); void setPathFactory(ContentPathFactory pathFactory);  }### Answer:
@Test public void getPatronRoleAssignmentsDirect() { addPidToAncestors(); PID collPid = makePid(); mockObjPatronRoleAssignments(new RoleAssignment(PUBLIC_PRINC, UserRole.canViewOriginals, collPid)); List<RoleAssignment> assignments = aclFactory.getPatronRoleAssignments(collPid); assertEquals(1, assignments.size()); RoleAssignment assignment = getAssignmentByPidAndRole(assignments, collPid, UserRole.canViewOriginals); assertEquals(PUBLIC_PRINC, assignment.getPrincipal()); }
@Test public void getPatronRoleAssignmentsInherited() { addPidToAncestors(); PID collPid = addPidToAncestors(); PID folderPid = makePid(); mockObjPatronRoleAssignments(new RoleAssignment(PUBLIC_PRINC, UserRole.canViewAccessCopies, collPid), new RoleAssignment(AUTHENTICATED_PRINC, UserRole.canViewOriginals, collPid)); mockObjPatronRoleAssignments(new RoleAssignment(PUBLIC_PRINC, UserRole.canViewMetadata, folderPid)); List<RoleAssignment> assignments = aclFactory.getPatronRoleAssignments(folderPid); assertEquals(3, assignments.size()); RoleAssignment assignment1 = getAssignmentByPidAndRole(assignments, collPid, UserRole.canViewAccessCopies); assertEquals(PUBLIC_PRINC, assignment1.getPrincipal()); RoleAssignment assignment2 = getAssignmentByPidAndRole(assignments, collPid, UserRole.canViewOriginals); assertEquals(AUTHENTICATED_PRINC, assignment2.getPrincipal()); RoleAssignment assignment3 = getAssignmentByPidAndRole(assignments, folderPid, UserRole.canViewMetadata); assertEquals(PUBLIC_PRINC, assignment3.getPrincipal()); }
@Test public void getPatronRoleAssignmentsNone() { addPidToAncestors(); PID collPid = makePid(); List<RoleAssignment> assignments = aclFactory.getPatronRoleAssignments(collPid); assertTrue("No assignments should be returned", assignments.isEmpty()); }