WorkflowBundleIO { public WorkflowBundleWriter getWriterForMediaType(String mediaType) { for (WorkflowBundleWriter writer : getWriters()) if (writer.getMediaTypes().contains(mediaType)) return writer; 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 getWriterForMediaType() throws Exception { WorkflowBundleWriter writer = bundleIO .getWriterForMediaType(TEXT_VND_TAVERNA_SCUFL2_STRUCTURE); assertTrue(writer instanceof StructureWriter); }
@Test public void getWriterForUnknownMediaType() throws Exception { assertNull(bundleIO .getWriterForMediaType("application/vnd.example.unknownStuff")); }