public static Object convertToObject(final Any any) throws InvalidProtocolBufferException {
        if (null == any || any.is(Empty.class)) {
            return null;
        }
        if (any.is(StringValue.class)) {
            return any.unpack(StringValue.class).getValue();
        }
        if (any.is(Int32Value.class)) {
            return any.unpack(Int32Value.class).getValue();
        }
        if (any.is(Int64Value.class)) {
            return any.unpack(Int64Value.class).getValue();
        }
        if (any.is(Int64Value.class)) {
            return any.unpack(Int64Value.class).getValue();
        }
        if (any.is(UInt32Value.class)) {
            return any.unpack(UInt64Value.class).getValue();
        }
        if (any.is(UInt64Value.class)) {
            return any.unpack(UInt64Value.class).getValue();
        }
        if (any.is(FloatValue.class)) {
            return any.unpack(FloatValue.class).getValue();
        }
        if (any.is(DoubleValue.class)) {
            return any.unpack(DoubleValue.class).getValue();
        }
        if (any.is(BoolValue.class)) {
            return any.unpack(BoolValue.class).getValue();
        }
        if (any.is(BytesValue.class)) {
            return any.unpack(BytesValue.class).getValue().toByteArray();
        }
        if (any.is(com.google.protobuf.Timestamp.class)) {
            return converProtobufTimestamp(any.unpack(com.google.protobuf.Timestamp.class));
        }
        if (any.is(Struct.class)) {
            return JsonFormat.printer().print(any.unpack(Struct.class));
        }
        // TODO can't use JsonFormat, might change the original value without error prompt. there need to cover more types,
        log.error("not support unpack value={}", any);
        throw new UnsupportedOperationException(String.format("not support unpack the type %s", any.getTypeUrl()));
    }
@Test
    void assertConvertToObject() throws InvalidProtocolBufferException {
        Object actual = ProtobufAnyValueConverter.convertToObject(Any.pack(Int32Value.of(123)));
        assertThat(actual, is(123));
        actual = ProtobufAnyValueConverter.convertToObject(Any.pack(Int64Value.of(Long.MAX_VALUE)));
        assertThat(actual, is(Long.MAX_VALUE));
        OffsetDateTime now = OffsetDateTime.now();
        actual = ProtobufAnyValueConverter.convertToObject(Any.pack(com.google.protobuf.Timestamp.newBuilder().setSeconds(now.toEpochSecond()).setNanos(now.getNano()).build()));
        assertThat(actual, is(Timestamp.valueOf(now.toLocalDateTime())));
        actual = ProtobufAnyValueConverter.convertToObject(Any.pack(FloatValue.of(1.23F)));
        assertThat(actual, is(1.23F));
        actual = ProtobufAnyValueConverter.convertToObject(Any.pack(DoubleValue.of(4.56D)));
        assertThat(actual, is(4.56D));
        actual = ProtobufAnyValueConverter.convertToObject(Any.pack(StringValue.of("Hello")));
        assertThat(actual, is("Hello"));
        actual = ProtobufAnyValueConverter.convertToObject(Any.pack(BoolValue.of(true)));
        assertTrue((Boolean) actual);
        actual = ProtobufAnyValueConverter.convertToObject(Any.pack(BytesValue.of(ByteString.copyFrom(new byte[]{1, 2, 3}))));
        assertThat(actual, is(new byte[]{1, 2, 3}));
        actual = ProtobufAnyValueConverter.convertToObject(Any.pack(UInt64Value.of(101010L)));
        assertThat(actual, is(101010L));
        actual = ProtobufAnyValueConverter.convertToObject(Any.pack(Empty.getDefaultInstance()));
        assertNull(actual);
        actual = Struct.newBuilder().putFields("str", Value.newBuilder().setStringValue("ABC defg").build())
                .putFields("null", Value.newBuilder().setNullValue(NullValue.NULL_VALUE).build())
                .putFields("number", Value.newBuilder().setNumberValue(123.45D).build())
                .putFields("list", Value.newBuilder().setListValue(ListValue.newBuilder().addValues(Value.newBuilder().setNumberValue(1)).build()).build()).build();
        Builder expected = Struct.newBuilder();
        JsonFormat.parser().merge((String) ProtobufAnyValueConverter.convertToObject(Any.pack((Struct) actual)), expected);
        assertThat(actual.toString(), is(expected.toString()));
    }