### Question:
PermissionsHelper { public boolean allowsPublicAccess(BriefObjectMetadata metadata) { if (metadata.getRoleGroup() == null) { return false; } return metadata.getRoleGroup().contains(PUBLIC_ROLE_VALUE); } PermissionsHelper(); boolean hasOriginalAccess(AccessGroupSet principals, BriefObjectMetadata metadata); boolean hasThumbnailAccess(AccessGroupSet principals, BriefObjectMetadata metadata); boolean hasImagePreviewAccess(AccessGroupSet principals, BriefObjectMetadata metadata); boolean hasDescriptionAccess(AccessGroupSet principals, BriefObjectMetadata metadata); boolean hasDatastreamAccess(AccessGroupSet principals, DatastreamType datastream,
            BriefObjectMetadata metadata); boolean hasEditAccess(AccessGroupSet principals, BriefObjectMetadata metadata); boolean allowsPublicAccess(BriefObjectMetadata metadata); AccessControlService getAccessControlService(); void setAccessControlService(AccessControlService accessControlService);  }### Answer:
@Test public void testAllowsPublicAccess() { roleGroups.add("canViewOriginals|everyone"); assertTrue("Failed to determine object has full patron access", helper.allowsPublicAccess(mdObject)); }
@Test public void testDoesNotAllowPublicAccess() { roleGroups.add("canViewMetadata|everyone"); assertFalse("Object must not have full patron access", helper.allowsPublicAccess(mdObject)); }
@Test public void testAllowsPublicAccessNoRoleGroups() { mdObject.setRoleGroup(null); assertFalse("Object must not have full patron access", helper.allowsPublicAccess(mdObject)); }