public CsvReader includeFields(boolean... fields) {
        if (fields == null || fields.length == 0) {
            throw new IllegalArgumentException(
                    "The set of included fields must not be null or empty.");
        }

        int lastTruePos = -1;
        for (int i = 0; i < fields.length; i++) {
            if (fields[i]) {
                lastTruePos = i;
            }
        }

        if (lastTruePos == -1) {
            throw new IllegalArgumentException(
                    "The description of fields to parse excluded all fields. At least one fields must be included.");
        }
        if (lastTruePos == fields.length - 1) {
            this.includedMask = fields;
        } else {
            this.includedMask = Arrays.copyOfRange(fields, 0, lastTruePos + 1);
        }
        return this;
    }
@Test
    void testIncludeFieldsErrorWhenExcludingAll() {
        CsvReader reader = getCsvReader();

        assertThatThrownBy(() -> reader.includeFields(false, false, false, false, false, false))
                .withFailMessage(
                        "The reader accepted a fields configuration that excludes all fields.")
                .isInstanceOf(IllegalArgumentException.class);

        assertThatThrownBy(() -> reader.includeFields(0))
                .withFailMessage(
                        "The reader accepted a fields configuration that excludes all fields.")
                .isInstanceOf(IllegalArgumentException.class);

        assertThatThrownBy(() -> reader.includeFields("ffffffffffffff"))
                .withFailMessage(
                        "The reader accepted a fields configuration that excludes all fields.")
                .isInstanceOf(IllegalArgumentException.class);

        assertThatThrownBy(() -> reader.includeFields("00000000000000000"))
                .withFailMessage(
                        "The reader accepted a fields configuration that excludes all fields.")
                .isInstanceOf(IllegalArgumentException.class);
    }