private void check(final String[] columnData, final int[] lengths, final String[] expected, final boolean preserveLeading,
            final boolean preserveTrailing) {
        final List<ColumnMetaData> columnMetaData = new ArrayList<ColumnMetaData>();

        assertEquals("data and col lengths different size...", columnData.length, lengths.length);

        for (final int length : lengths) {
            final ColumnMetaData cmd = new ColumnMetaData();
            cmd.setColLength(length);
            columnMetaData.add(cmd);
        }

        final StringBuilder lineToParse = new StringBuilder();
        for (int i = 0; i < columnData.length; i++) {
            // padd each column
            lineToParse.append(columnData[i]).append(ParserUtils.padding(lengths[i] - columnData[i].length(), ' '));
        }

        final List<String> splitResult = FixedWidthParserUtils.splitFixedText(columnMetaData, lineToParse.toString(), preserveLeading,
                preserveTrailing);

        // compare the parse results to the expected results
        assertEquals("did not return correct number of cols...", expected.length, splitResult.size());

        for (int i = 0; i < expected.length; i++) {
            assertEquals("col values don't match...", expected[i], splitResult.get(i));
        }

    }