public boolean apply(Object candidate) {
        if (from instanceof Integer) {
            return ((Integer)candidate > (Integer)from) && ((Integer)candidate < (Integer)to);
        }
        if (from instanceof Long) {
            return ((Long)candidate > (Long)from) && ((Long)candidate < (Long)to);
        }
        return ((Double)candidate > (Double)from) && ((Double)candidate < (Double)to);
    }