public List<ColumnMatchResult<?>> getMismatchedColumns(List<Column> columns, ChecksumResult controlChecksum, ChecksumResult testChecksum)
    {
        return columns.stream()
                .flatMap(column -> columnValidators.get(column.getCategory()).get().validate(column, controlChecksum, testChecksum).stream())
                .filter(columnMatchResult -> !columnMatchResult.isMatched())
                .collect(toImmutableList());
    }
@Test
    public void testValidateVarcharArrayAsDoubleArray()
    {
        Map<String, Object> equalNullCount = ImmutableMap.<String, Object>builder()
                .put("varchar_array$null_count", 1L)
                .put("varchar_array_as_double$null_count", 1L)
                .build();
        Map<String, Object> unequalNullCount = ImmutableMap.<String, Object>builder()
                .put("varchar_array$null_count", 1L)
                .put("varchar_array_as_double$null_count", 2L)
                .build();
        Map<String, Object> asDoubleArrayCounts = ImmutableMap.<String, Object>builder()
                .put("varchar_array_as_double$nan_count", 2L)
                .put("varchar_array_as_double$pos_inf_count", 3L)
                .put("varchar_array_as_double$neg_inf_count", 4L)
                .build();

        List<Column> columns = ImmutableList.of(VARCHAR_ARRAY_COLUMN);
        ChecksumResult controlChecksum = new ChecksumResult(
                10,
                ImmutableMap.<String, Object>builder()
                        .put("varchar_array$checksum", new SqlVarbinary(new byte[] {0xb}))
                        .putAll(equalNullCount)
                        .put("varchar_array_as_double$sum", 1.0)
                        .putAll(asDoubleArrayCounts)

                        .put("varchar_array$cardinality_checksum", new SqlVarbinary(new byte[] {0xd}))
                        .put("varchar_array$cardinality_sum", 10L)
                        .build());

        // Matched as double.
        ChecksumResult testChecksum = new ChecksumResult(
                10,
                ImmutableMap.<String, Object>builder()
                        .put("varchar_array$checksum", new SqlVarbinary(new byte[] {0x1b}))
                        .putAll(equalNullCount)
                        .put("varchar_array_as_double$sum", 1 + RELATIVE_ERROR_MARGIN)
                        .putAll(asDoubleArrayCounts)

                        .put("varchar_array$cardinality_checksum", new SqlVarbinary(new byte[] {0xd}))
                        .put("varchar_array$cardinality_sum", 10L)
                        .build());
        assertTrue(stringAsDoubleValidator.getMismatchedColumns(columns, controlChecksum, testChecksum).isEmpty());

        // Mismatched as varchar.
        testChecksum = new ChecksumResult(
                10,
                ImmutableMap.<String, Object>builder()
                        .put("varchar_array$checksum", new SqlVarbinary(new byte[] {0xb}))
                        .putAll(equalNullCount)
                        .put("varchar_array_as_double$sum", 1.0)
                        .putAll(asDoubleArrayCounts)

                        .put("varchar_array$cardinality_checksum", new SqlVarbinary(new byte[] {0x1d}))
                        .put("varchar_array$cardinality_sum", 10L)
                        .build());
        assertMismatchedColumns(columns, controlChecksum, testChecksum, stringAsDoubleValidator, VARCHAR_ARRAY_COLUMN);

        // Mismatched as varchar.
        testChecksum = new ChecksumResult(
                10,
                ImmutableMap.<String, Object>builder()
                        .put("varchar_array$checksum", new SqlVarbinary(new byte[] {0x1b}))
                        .putAll(unequalNullCount)
                        .put("varchar_array_as_double$sum", 1.0)
                        .putAll(asDoubleArrayCounts)

                        .put("varchar_array$cardinality_checksum", new SqlVarbinary(new byte[] {0xd}))
                        .put("varchar_array$cardinality_sum", 10L)
                        .build());
        assertMismatchedColumns(columns, controlChecksum, testChecksum, stringAsDoubleValidator, VARCHAR_ARRAY_COLUMN);

        // Mismatched as either double or varchar.
        testChecksum = new ChecksumResult(
                10,
                ImmutableMap.<String, Object>builder()
                        .put("varchar_array$checksum", new SqlVarbinary(new byte[] {0x1b}))
                        .putAll(equalNullCount)
                        .put("varchar_array_as_double$sum", 1 - RELATIVE_ERROR_MARGIN * 10)
                        .putAll(asDoubleArrayCounts)

                        .put("varchar_array$cardinality_checksum", new SqlVarbinary(new byte[] {0xd}))
                        .put("varchar_array$cardinality_sum", 10L)
                        .build());
        assertMismatchedColumns(columns, controlChecksum, testChecksum, stringAsDoubleValidator, VARCHAR_ARRAY_COLUMN);
    }