@Override
    public <Y> Y convert(IntNode node, Class<Y> cls) {
        if (Object.class.equals(cls) || Number.class.equals(cls)) {
            cls = (Class<Y>) Long.class;
        } else if (cls.isPrimitive()) {
            cls = (Class<Y>) WRAPPERS.get((Class<? extends Number>) cls);
            if (cls == null) {
                throw new BencDeserializer.DeserializationException(
                        "Number should be deserialized to numeric primitive field");
            }
        }
        if (!Number.class.isAssignableFrom(cls)) {
            throw new BencDeserializer.DeserializationException(
                    "Number should be deserialized to numeric field");
        }
        String val = Long.toString(node.getValue());
        try {
            Constructor c = cls.getConstructor(String.class);
            return (Y) c.newInstance(val);
        } catch (NoSuchMethodException | SecurityException | InstantiationException
                | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
            throw new BencDeserializer.DeserializationException(
                    "Unexpected error: " + e);
        }
    }