TaskApplicationDescriptorImpl extends ApplicationDescriptorImpl<TaskApplicationDescriptor> implements TaskApplicationDescriptor { @Override public TaskApplicationDescriptor withTaskFactory(TaskFactory factory) { this.taskFactory = factory; return this; } TaskApplicationDescriptorImpl(TaskApplication userApp, Config config); @Override TaskApplicationDescriptor withTaskFactory(TaskFactory factory); @Override TaskApplicationDescriptor withInputStream(InputDescriptor inputDescriptor); @Override TaskApplicationDescriptor withOutputStream(OutputDescriptor outputDescriptor); @Override TaskApplicationDescriptor withTable(TableDescriptor tableDescriptor); TaskFactory getTaskFactory();  }
@Test public void testWithTaskFactory() { TaskFactory mockTf = mock(TaskFactory.class); TaskApplication testApp = appDesc -> appDesc.withTaskFactory(mockTf); TaskApplicationDescriptorImpl appDesc = new TaskApplicationDescriptorImpl(testApp, config); assertEquals(appDesc.getTaskFactory(), mockTf); }