@Override
    public void setParameters(Collection<CompoundVariable> parameters) throws InvalidVariableException {

        checkParameterCount(parameters, 0, 2);

        Object []values = parameters.toArray();
        int count = values.length;

        if (count > 0) {
            format = ((CompoundVariable) values[0]).execute();
        }

        if (count > 1) {
            variable = ((CompoundVariable)values[1]).execute().trim();
        }

    }
@Test
    void testTooMany() throws Exception {
        params.add(new CompoundVariable("YMD"));
        params.add(new CompoundVariable("NAME"));
        params.add(new CompoundVariable("YMD"));
        assertThrows(InvalidVariableException.class, () -> variable.setParameters(params));
    }