class ResponseQueue {

    boolean offer(ResponseType type, Maybe<Response> waitFor) {
        if (!pending.containsKey(type)) {
            if (waitFor instanceof MaybeSubject) {
                pending.put(type, (MaybeSubject<Response>) waitFor);
                return true;
            } else {
                return false;
            }
        } else {
            return false;
        }
    }

}