WorkflowBundleIO { public WorkflowBundleReader getReaderForMediaType(String mediaType) { for (WorkflowBundleReader reader : getReaders()) if (reader.getMediaTypes().contains(mediaType)) return reader; return null; }  WorkflowBundleReader getReaderForMediaType(String mediaType); List<WorkflowBundleReader> getReaders(); Set<String> getSupportedReaderMediaTypes(); Set<String> getSupportedWriterMediaTypes(); WorkflowBundleWriter getWriterForMediaType(String mediaType); List<WorkflowBundleWriter> getWriters(); String guessMediaTypeForSignature(byte[] firstBytes); WorkflowBundle readBundle(File bundleFile, String mediaType); WorkflowBundle readBundle(InputStream inputStream, String mediaType); WorkflowBundle readBundle(URL url, String mediaType); void setReaders(List<WorkflowBundleReader> readers); void setWriters(List<WorkflowBundleWriter> writers); void writeBundle(WorkflowBundle wfBundle, File destination,
			String mediaType); void writeBundle(WorkflowBundle wfBundle, OutputStream output,
			String mediaType); WorkflowBundle createBundle();  }
@Test public void getReaderForMediaType() throws Exception { WorkflowBundleReader Reader = bundleIO .getReaderForMediaType(TEXT_VND_TAVERNA_SCUFL2_STRUCTURE); assertTrue(Reader instanceof StructureReader); }
@Test public void getReaderForUnknownMediaType() throws Exception { assertNull(bundleIO .getReaderForMediaType("application/vnd.example.unknownStuff")); }