@Override
    public Object[] extract(Tuple in) {
        Object[] output;

        if (order == null) {
            // copy the whole tuple
            output = new Object[in.getArity()];
            for (int i = 0; i < in.getArity(); i++) {
                output[i] = in.getField(i);
            }
        } else {
            // copy user specified order
            output = new Object[order.length];
            for (int i = 0; i < order.length; i++) {
                output[i] = in.getField(order[i]);
            }
        }

        return output;
    }
@Test
    void testConvertFromTupleToArray() throws InstantiationException, IllegalAccessException {
        for (int i = 0; i < Tuple.MAX_ARITY; i++) {
            Tuple currentTuple = (Tuple) CLASSES[i].newInstance();
            String[] currentArray = new String[i + 1];
            for (int j = 0; j <= i; j++) {
                currentTuple.setField(testStrings[j], j);
                currentArray[j] = testStrings[j];
            }
            arrayEqualityCheck(currentArray, new ArrayFromTuple().extract(currentTuple));
        }
    }