public TestAnalysis(final Configuration configuration, final Class<? extends AbstractReaderPlugin> readerClass) throws Exception { this.analysisController = new AnalysisController(); final AbstractReaderPlugin reader = this.newReader(readerClass, configuration, this.analysisController); final String outputPortName = reader.getAllOutputPortNames()[0]; this.sinkPlugin = new ListCollectionFilter<IMonitoringRecord>(new Configuration(), this.analysisController); this.analysisController.connect(reader, outputPortName, this.sinkPlugin, ListCollectionFilter.INPUT_PORT_NAME); this.thread = new Thread("TestAnalysis thread") { @Override public void run() { try { TestAnalysis.this.getAnalysisController().run(); } catch (IllegalStateException | AnalysisConfigurationException e) { throw new IllegalStateException("Should never happen", e); } } }; }