void close() {
        if (spawnErrToSystemErr != null) {
            spawnErrToSystemErr.stopProcessing();
        }
        if (spawnOutToSystemOut != null) {
            spawnOutToSystemOut.stopProcessing();
        }
        if (systemOut != null) {
            try {
                systemOut.sink().close();
            } catch (IOException e) {
                LOG.warn("Closing stdout sink failed", e);
            }
            try {
                systemOut.source().close();
            } catch (IOException e) {
                LOG.warn("Closing stdout source failed", e);
            }
        }
        if (systemErr != null) {
            try {
                systemErr.sink().close();
            } catch (IOException e) {
                LOG.warn("Closing stderr sink failed", e);
            }
            try {
                systemErr.source().close();
            } catch (IOException e) {
                LOG.warn("Closing stderr source failed", e);
            }
        }
    }