### Question:
DatastreamPermissionUtil { public static Permission getPermissionForDatastream(String dsName) { if (StringUtils.isBlank(dsName)) { throw new IllegalArgumentException("A non-null datastream name must be provided"); } DatastreamType datastream = getByIdentifier(dsName); if (datastream == null) { return viewHidden; } return getPermissionForDatastream(datastream); } private  DatastreamPermissionUtil(); static Permission getPermissionForDatastream(String dsName); static Permission getPermissionForDatastream(DatastreamType datastream);  }### Answer:
@Test public void testGetDatastreamPermissionByName() { assertEquals(viewOriginal, getPermissionForDatastream(ORIGINAL_FILE.getId())); }
@Test(expected = IllegalArgumentException.class) public void testGetDatastreamPermissionNoName() { getPermissionForDatastream(""); }
@Test public void testGetDatastreamPermissionUnknownType() { assertEquals(viewHidden, getPermissionForDatastream("unknown")); }
@Test public void testGetDatastreamPermissionByType() { assertEquals(viewAccessCopies, getPermissionForDatastream(JP2_ACCESS_COPY)); }