public <T extends Value<?>> T getTypedReturnValue (String key, Class<T> type) {
        Value<?> v = Bencode.copyOf(returnValues.get(key));

        if (type.isInstance(v)) {
            return type.cast(Bencode.copyOf(v));
        } else {
            return null;
        }
    }