### Question:
DatastreamUtil { public static String getDatastreamUrl(BriefObjectMetadata metadata, String datastreamName) { Datastream preferredDS = getPreferredDatastream(metadata, datastreamName); if (preferredDS == null) { return ""; } StringBuilder url = new StringBuilder(); if (!isBlank(preferredDS.getExtension())) { if (INDEXABLE_EXTENSIONS.contains(preferredDS.getExtension())) { url.append("indexable"); } } url.append("content/"); if (isBlank(preferredDS.getOwner())) { url.append(metadata.getId()); } else { url.append(preferredDS.getOwner()); } if (!ORIGINAL_FILE.getId().equals(preferredDS.getName())) { url.append("/").append(preferredDS.getName()); } return url.toString(); } private  DatastreamUtil(); static void setDatastreamEndpoint(String uri); static String getDatastreamUrl(BriefObjectMetadata metadata, String datastreamName); static String getOriginalFileUrl(BriefObjectMetadata metadata); static Datastream getPreferredDatastream(BriefObjectMetadata metadata, String datastreamName); static String getThumbnailUrl(BriefObjectMetadata metadata, String size);  }### Answer:
@Test public void testGetDatastreamUrl() { PID pid = makePid(); BriefObjectMetadataBean mdObj = new BriefObjectMetadataBean(); mdObj.setId(pid.getId()); mdObj.setDatastream(asList(FITS_DS)); String url = DatastreamUtil.getDatastreamUrl(mdObj, TECHNICAL_METADATA.getId()); assertEquals("indexablecontent/" + pid.getId() + "/techmd_fits", url); }