public static double[] getVals(Param p) {
        Object o = p.getValue();
        if (o.getClass() == double[].class) {
            return (double[]) o;
        } else if (o.getClass() == Double.class) {
            return new double[]{(Double) o};
        }
        throw new IllegalArgumentException(p.toString());
    }