@SuppressWarnings("unchecked")
    @Override
    public OUT[] extract(Object in) {
        OUT[] output = (OUT[]) Array.newInstance(clazz, order.length);
        for (int i = 0; i < order.length; i++) {
            output[i] = (OUT) Array.get(in, this.order[i]);
        }
        return output;
    }
@Test
    void testIntArray() {
        for (int i = 0; i < testIntArray.length; i++) {
            Integer[] tmp = {testIntArray[i]};
            arrayEqualityCheck(tmp, new FieldsFromArray<>(Integer.class, i).extract(testIntArray));
        }

        // check reverse order
        Integer[] reverseOrder = new Integer[testIntArray.length];
        for (int i = 0; i < testIntArray.length; i++) {
            reverseOrder[i] = testIntArray[testIntArray.length - i - 1];
        }
        arrayEqualityCheck(
                reverseOrder,
                new FieldsFromArray<>(Integer.class, 4, 3, 2, 1, 0).extract(testIntArray));

        // check picking fields and reorder
        Integer[] crazyOrder = {testIntArray[4], testIntArray[1], testIntArray[2]};
        arrayEqualityCheck(
                crazyOrder, new FieldsFromArray<>(Integer.class, 4, 1, 2).extract(testIntArray));
    }