public boolean close(InterceptedStream<T> stream) {

        // Remove stream if present
        boolean wasRemoved = streams.remove(stream.getIndex(), stream);

        // Close provided stream
        close(stream.getStream());

        return wasRemoved;

    }
Closes the given stream, logging any errors that occur during closure,
and unblocking any in-progress calls to waitFor() for the given stream.
If the given stream is stored within this map, it will also be removed.

@param stream
    The stream to close.

@return
    true if the given stream was stored within this map, false
    otherwise.
guacamole/src/main/java/org/apache/guacamole/tunnel/InterceptedStreamMap.java