Project { @Inject public void initialize(StepConverter stepConverter, SourceConverter sourceConverter, SocketConverter socketConverter, ConnectionConverter connectionConverter, ProjectSettingsConverter projectSettingsConverter, CodeGenerationSettingsConverter codeGenerationSettingsConverter) { xstream.setMode(XStream.NO_REFERENCES); xstream.ignoreUnknownElements(); xstream.registerConverter(stepConverter); xstream.registerConverter(sourceConverter); xstream.registerConverter(socketConverter); xstream.registerConverter(connectionConverter); xstream.registerConverter(projectSettingsConverter); xstream.registerConverter(codeGenerationSettingsConverter); try { MetaInfReader.readClasses(ClassListProcessor.XSTREAM_ALIASES_FILE_NAME) .forEach(xstream::processAnnotations); } catch (IOException ex) { throw new AssertionError("Could not load classes for XStream annotation processing", ex); } }  @Inject void initialize(StepConverter stepConverter,
                         SourceConverter sourceConverter,
                         SocketConverter socketConverter,
                         ConnectionConverter connectionConverter,
                         ProjectSettingsConverter projectSettingsConverter,
                         CodeGenerationSettingsConverter codeGenerationSettingsConverter); Optional<File> getFile(); void setFile(Optional<File> file); void open(File file); void open(String projectXml); boolean trySave(File file); void save(File file); void save(Writer writer); boolean isSaveDirty(); void addIsSaveDirtyConsumer(Consumer<Boolean> consumer); @Subscribe void onDirtiesSaveEvent(DirtiesSaveEvent dirtySaveEvent);  }
@Test @SuppressWarnings("PMD.JUnitTestsShouldIncludeAssert") public void testSerializePipelineWithSource() throws Exception { final ImageFileSource source = imageSourceFactory.create(Files.gompeiJpegFile.file); source.initialize(); eventBus.post(new SourceAddedEvent(source)); serializeAndDeserialize(); final ImageFileSource sourceDeserialized = (ImageFileSource) pipeline.getSources().get(0); Files.gompeiJpegFile.assertSameImage( (MatWrapper) sourceDeserialized.createOutputSockets().get(0).getValue().get()); }