``` # A hack to get hold of the workunit that g...
# general
h
Copy code
# A hack to get hold of the workunit that gets created inside execute_java.
    # We need it in order to grab the stdout.
    workunit_container = [None]
    @contextmanager
    def workunit_factory(*args, **kwargs):
      with self.context.new_workunit(*args, **kwargs) as workunit:
        workunit_container[0] = workunit
        yield workunit