@Override
    public void configure(Configuration parameters) {
        super.configure(parameters);

        // the if() clauses are to prevent the configure() method from
        // overwriting the values set by the setters

        if (Arrays.equals(delimiter, new byte[] {'\n'})) {
            String delimString = parameters.getString(RECORD_DELIMITER, null);
            if (delimString != null) {
                setDelimiter(delimString);
            }
        }

        // set the number of samples
        if (numLineSamples == NUM_SAMPLES_UNDEFINED) {
            String samplesString = parameters.getString(NUM_STATISTICS_SAMPLES, null);
            if (samplesString != null) {
                try {
                    setNumLineSamples(Integer.parseInt(samplesString));
                } catch (NumberFormatException e) {
                    if (LOG.isWarnEnabled()) {
                        LOG.warn(
                                "Invalid value for number of samples to take: "
                                        + samplesString
                                        + ". Skipping sampling.");
                    }
                    setNumLineSamples(0);
                }
            }
        }
    }
@Test
    void testConfigure() {
        Configuration cfg = new Configuration();
        cfg.setString("delimited-format.delimiter", "\n");

        format.configure(cfg);
        assertThat(new String(format.getDelimiter(), format.getCharset())).isEqualTo("\n");

        cfg.setString("delimited-format.delimiter", "&-&");
        format.configure(cfg);
        assertThat(new String(format.getDelimiter(), format.getCharset())).isEqualTo("&-&");
    }