### Question:
PipelineImpl implements Pipeline { @Override public InputStream cat(Key task) { if (!workings.contains(task)) { return null; } if (tasks.get(task) == null) { return null; } return tasks.get(task).openStdout(); } @Inject  PipelineImpl(Context ctx); @Override Key submit(Task<BuildResult> task); @Override Task<BuildResult> get(Key taskId); @Override void cancel(Key taskId); @Override List<Key> list(Filter... filters); @Override InputStream cat(Key task); @Override void addListener(Listener listener); @Override void removeListener(Listener listener); @Override void waitFor(Key... k); @Override void waitFor(long time, TimeUnit unit, Key... ks); @Override Future<BuildResult> getFuture(Key k);  }### Answer:
@Test public void cat() throws Exception { CriticalResource repo = getLock("/"); repo.getLock().lock(); Task<BuildResult> t1 = createTask("/", 100); Key k1 = pipeline.submit(t1); assertThat(pipeline.cat(k1)).isNull(); repo.getLock().unlock(); Thread.sleep(5); assertThat(pipeline.cat(k1)).isNotNull(); Thread.sleep(100); assertThat(pipeline.cat(k1)).isNull(); }