@SuppressWarnings("deprecation")
    @SneakyThrows(SQLException.class)
    public static Message convertToProtobufMessage(final Object object) {
        if (null == object) {
            return Empty.getDefaultInstance();
        }
        if (object instanceof Integer) {
            return Int32Value.of((int) object);
        }
        if (object instanceof Short) {
            return Int32Value.of(((Short) object).intValue());
        }
        if (object instanceof Byte) {
            return Int32Value.of(((Byte) object).intValue());
        }
        if (object instanceof Long) {
            return Int64Value.of((long) object);
        }
        if (object instanceof BigInteger) {
            return StringValue.of(object.toString());
        }
        if (object instanceof Float) {
            return FloatValue.of((float) object);
        }
        if (object instanceof Double) {
            return DoubleValue.of((double) object);
        }
        if (object instanceof BigDecimal) {
            return StringValue.of(object.toString());
        }
        if (object instanceof String) {
            return StringValue.of(object.toString());
        }
        if (object instanceof Boolean) {
            return BoolValue.of((boolean) object);
        }
        if (object instanceof byte[]) {
            return BytesValue.of(ByteString.copyFrom((byte[]) object));
        }
        if (object instanceof Time) {
            Time time = (Time) object;
            LocalTime localTime = LocalTime.of(time.getHours(), time.getMinutes(), time.getSeconds(), new Timestamp(time.getTime()).getNanos());
            return Int64Value.of(localTime.toNanoOfDay());
        }
        if (object instanceof java.sql.Date) {
            return Int64Value.of(((java.sql.Date) object).toLocalDate().toEpochDay());
        }
        if (object instanceof Date) {
            return converToProtobufTimestamp((Date) object);
        }
        if (object instanceof LocalDateTime) {
            return converToProtobufTimestamp(Timestamp.valueOf((LocalDateTime) object));
        }
        if (object instanceof LocalDate) {
            return Int64Value.of(((LocalDate) object).toEpochDay());
        }
        if (object instanceof LocalTime) {
            return Int64Value.of(((LocalTime) object).toNanoOfDay());
        }
        if (object instanceof OffsetDateTime) {
            LocalDateTime localDateTime = ((OffsetDateTime) object).toLocalDateTime();
            return converToProtobufTimestamp(Timestamp.valueOf(localDateTime));
        }
        if (object instanceof OffsetTime) {
            return Int64Value.of(((OffsetTime) object).toLocalTime().toNanoOfDay());
        }
        if (object instanceof ZonedDateTime) {
            return converToProtobufTimestamp(Timestamp.valueOf(((ZonedDateTime) object).toLocalDateTime()));
        }
        if (object instanceof Instant) {
            Instant instant = (Instant) object;
            return com.google.protobuf.Timestamp.newBuilder().setSeconds(instant.getEpochSecond()).setNanos(instant.getNano()).build();
        }
        if (object instanceof Clob) {
            Clob clob = (Clob) object;
            return StringValue.of(clob.getSubString(1L, (int) clob.length()));
        }
        if (object instanceof Blob) {
            Blob blob = (Blob) object;
            return BytesValue.of(ByteString.copyFrom(blob.getBytes(1L, (int) blob.length())));
        }
        return StringValue.newBuilder().setValue(object.toString()).build();
    }
@Test
    void assertConvertToProtobufMessage() {
        Message actualMessage = ColumnValueConvertUtils.convertToProtobufMessage(null);
        assertTrue(actualMessage instanceof Empty);
        actualMessage = ColumnValueConvertUtils.convertToProtobufMessage(1);
        assertTrue(actualMessage instanceof Int32Value);
        assertThat(((Int32Value) actualMessage).getValue(), is(1));
        actualMessage = ColumnValueConvertUtils.convertToProtobufMessage((byte) 1);
        assertTrue(actualMessage instanceof Int32Value);
        assertThat(((Int32Value) actualMessage).getValue(), is(1));
        actualMessage = ColumnValueConvertUtils.convertToProtobufMessage((short) 1);
        assertTrue(actualMessage instanceof Int32Value);
        assertThat(((Int32Value) actualMessage).getValue(), is(1));
        actualMessage = ColumnValueConvertUtils.convertToProtobufMessage(1L);
        assertTrue(actualMessage instanceof Int64Value);
        assertThat(((Int64Value) actualMessage).getValue(), is(1L));
        actualMessage = ColumnValueConvertUtils.convertToProtobufMessage(new BigInteger("1234"));
        assertTrue(actualMessage instanceof StringValue);
        assertThat(new BigInteger(((StringValue) actualMessage).getValue()), is(new BigInteger("1234")));
        actualMessage = ColumnValueConvertUtils.convertToProtobufMessage(1.0F);
        assertTrue(actualMessage instanceof FloatValue);
        assertThat(((FloatValue) actualMessage).getValue(), is(1.0F));
        actualMessage = ColumnValueConvertUtils.convertToProtobufMessage(1.23);
        assertTrue(actualMessage instanceof DoubleValue);
        assertThat(((DoubleValue) actualMessage).getValue(), is(1.23));
        actualMessage = ColumnValueConvertUtils.convertToProtobufMessage(new BigDecimal("100"));
        assertTrue(actualMessage instanceof StringValue);
        assertThat(((StringValue) actualMessage).getValue(), is("100"));
        actualMessage = ColumnValueConvertUtils.convertToProtobufMessage("abcd");
        assertTrue(actualMessage instanceof StringValue);
        assertThat(((StringValue) actualMessage).getValue(), is("abcd"));
        actualMessage = ColumnValueConvertUtils.convertToProtobufMessage(true);
        assertTrue(actualMessage instanceof BoolValue);
        assertTrue(((BoolValue) actualMessage).getValue());
        Timestamp now = new Timestamp(System.currentTimeMillis());
        long epochSecond = now.toInstant().getEpochSecond();
        actualMessage = ColumnValueConvertUtils.convertToProtobufMessage(now.toLocalDateTime());
        assertTrue(actualMessage instanceof com.google.protobuf.Timestamp);
        assertThat(((com.google.protobuf.Timestamp) actualMessage).getSeconds(), is(epochSecond));
        actualMessage = ColumnValueConvertUtils.convertToProtobufMessage(now);
        assertTrue(actualMessage instanceof com.google.protobuf.Timestamp);
        assertThat(((com.google.protobuf.Timestamp) actualMessage).getSeconds(), is(epochSecond));
        actualMessage = ColumnValueConvertUtils.convertToProtobufMessage(new Date(now.getTime()));
        assertTrue(actualMessage instanceof com.google.protobuf.Timestamp);
        assertThat(((com.google.protobuf.Timestamp) actualMessage).getSeconds(), is(epochSecond));
        actualMessage = ColumnValueConvertUtils.convertToProtobufMessage(now.toInstant());
        assertTrue(actualMessage instanceof com.google.protobuf.Timestamp);
        assertThat(((com.google.protobuf.Timestamp) actualMessage).getNanos(), is(now.toInstant().getNano()));
        actualMessage = ColumnValueConvertUtils.convertToProtobufMessage(now.toLocalDateTime().toLocalTime());
        assertTrue(actualMessage instanceof Int64Value);
        assertThat(((Int64Value) actualMessage).getValue(), is(now.toLocalDateTime().toLocalTime().toNanoOfDay()));
        actualMessage = ColumnValueConvertUtils.convertToProtobufMessage("123456".getBytes());
        assertTrue(actualMessage instanceof BytesValue);
        assertThat(((BytesValue) actualMessage).getValue().toByteArray(), is("123456".getBytes()));
        OffsetTime offsetTime = OffsetTime.now();
        actualMessage = ColumnValueConvertUtils.convertToProtobufMessage(offsetTime);
        assertTrue(actualMessage instanceof Int64Value);
        assertThat(((Int64Value) actualMessage).getValue(), is(offsetTime.toLocalTime().toNanoOfDay()));
        OffsetDateTime offsetDateTime = OffsetDateTime.now();
        actualMessage = ColumnValueConvertUtils.convertToProtobufMessage(offsetDateTime);
        assertTrue(actualMessage instanceof com.google.protobuf.Timestamp);
        assertThat(((com.google.protobuf.Timestamp) actualMessage).getSeconds(), is(offsetDateTime.toEpochSecond()));
        assertThat(((com.google.protobuf.Timestamp) actualMessage).getNanos(), is(offsetDateTime.getNano()));
    }