### Question:
ObjectAclFactory implements AclFactory { @Override public Date getEmbargoUntil(PID pid) { String embargoPropertyUri = CdrAcl.embargoUntil.getURI(); return getObjectAcls(pid).stream() .filter(p -> embargoPropertyUri.equals(p.getKey())) .findFirst() .map(p -> { try { return DateTimeUtil.parseUTCToDate(p.getValue()); } catch (IllegalArgumentException e) { log.warn("Failed to parse embargo {} for {} while retrieving ACLs", new Object[] {p.getValue(), pid}, e); return null; } }) .orElse(null); } ObjectAclFactory(); void init(); @Override Map<String, Set<String>> getPrincipalRoles(PID pid); @Override List<RoleAssignment> getStaffRoleAssignments(PID pid); @Override List<RoleAssignment> getPatronRoleAssignments(PID pid); @Override List<RoleAssignment> getPatronAccess(PID pid); @Override Date getEmbargoUntil(PID pid); @Override boolean isMarkedForDeletion(PID pid); long getCacheTimeToLive(); void setCacheTimeToLive(long cacheTimeToLive); long getCacheMaxSize(); void setCacheMaxSize(long cacheMaxSize); void setRepositoryObjectCacheLoader(RepositoryObjectCacheLoader repositoryObjectCacheLoader);  }### Answer:
@Test public void getEmbargoUntilTest() throws Exception { objResc.addLiteral(CdrAcl.canManage, MANAGE_GRP); objResc.addLiteral(CdrAcl.embargoUntil, TOMORROW); Date embargoDate = aclFactory.getEmbargoUntil(pid); assertNotNull(embargoDate); DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd", Locale.ENGLISH); SimpleDateFormat dt = new SimpleDateFormat("yyyy-MM-dd"); assertEquals(dtf.format(TOMORROW), dt.format(embargoDate)); }
@Test public void getNoEmbargoUntilTest() throws Exception { objResc.addLiteral(CdrAcl.canManage, MANAGE_GRP); Date embargoDate = aclFactory.getEmbargoUntil(pid); assertNull(embargoDate); }
@Test public void getInvalidEmbargoUntilTest() throws Exception { objResc.addLiteral(CdrAcl.embargoUntil, "notadate"); Date embargoDate = aclFactory.getEmbargoUntil(pid); assertNull(embargoDate); }