public IStatus download(URI toDownload, OutputStream target, IProgressMonitor pm) {
   byte[] contents = locationsToContents.get(toDownload);
   if (contents == null)
     Assert.fail(
         "Attempt to download missing artifact in TestArtifactRepository: " + toDownload);
   try {
     target.write(contents);
   } catch (IOException e) {
     e.printStackTrace();
     Assert.fail("Unexpected exception in TestArtifactRepository" + e.getMessage());
   }
   return Status.OK_STATUS;
 }