### Question:
InheritedAclFactory implements AclFactory { @Override public boolean isMarkedForDeletion(PID target) { return getPidPath(target).stream() .anyMatch(p -> objectAclFactory.isMarkedForDeletion(p)); }  @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 notMarkedForDeletion() { addPidToAncestors(); when(objectAclFactory.isMarkedForDeletion(any(PID.class))) .thenReturn(false); assertFalse(aclFactory.isMarkedForDeletion(pid)); }
@Test public void inheritMarkedForDeletion() { addPidToAncestors(); PID collPid = addPidToAncestors(); when(objectAclFactory.isMarkedForDeletion(eq(collPid))) .thenReturn(true); assertTrue(aclFactory.isMarkedForDeletion(pid)); }
@Test public void isMarkedForDeletion() { addPidToAncestors(); addPidToAncestors(); when(objectAclFactory.isMarkedForDeletion(eq(pid))) .thenReturn(true); assertTrue(aclFactory.isMarkedForDeletion(pid)); }