public static Collection<DatabasePacket> buildQueryResponsePackets(final QueryResponseHeader queryResponseHeader, final int characterSet, final int statusFlags) {
        Collection<DatabasePacket> result = new LinkedList<>();
        List<QueryHeader> queryHeaders = queryResponseHeader.getQueryHeaders();
        result.add(new MySQLFieldCountPacket(queryHeaders.size()));
        for (QueryHeader each : queryHeaders) {
            result.add(new MySQLColumnDefinition41Packet(characterSet, getColumnDefinitionFlag(each), each.getSchema(), each.getTable(), each.getTable(),
                    each.getColumnLabel(), each.getColumnName(), each.getColumnLength(), MySQLBinaryColumnType.valueOfJDBCType(each.getColumnType()), each.getDecimals(), false));
        }
        result.add(new MySQLEofPacket(statusFlags));
        return result;
    }
@SuppressWarnings({"unchecked", "rawtypes"})
    @Test
    void assertBuildQueryResponsePacketsWithBinaryColumnType() {
        QueryHeader nonBinaryHeader = new QueryHeader("s", "t", "columnLabel1", "columnName1", 5, "VARCHAR", 1, 1, false, false, false, false);
        QueryHeader binaryHeader = new QueryHeader("s", "t", "columnLabel2", "columnName2", 8, "VARBINARY", 1, 1, false, false, false, false);
        List<QueryHeader> queryHeaders = Arrays.asList(nonBinaryHeader, binaryHeader);
        QueryResponseHeader queryResponseHeader = new QueryResponseHeader(queryHeaders);
        List<DatabasePacket> actual = new ArrayList(ResponsePacketBuilder.buildQueryResponsePackets(queryResponseHeader, 255, 0));
        assertThat(actual.size(), is(4));
        byte[] actualNonBinaryData = new byte[48];
        actual.get(1).write(new MySQLPacketPayload(Unpooled.wrappedBuffer(actualNonBinaryData).writerIndex(0), StandardCharsets.UTF_8));
        assertThat(actualNonBinaryData[43] & 0x80, is(0));
        byte[] actualBinaryData = new byte[48];
        actual.get(2).write(new MySQLPacketPayload(Unpooled.wrappedBuffer(actualBinaryData).writerIndex(0), StandardCharsets.UTF_8));
        assertThat(actualBinaryData[43] & 0x80, is(0x80));
    }