public static Message parse(byte[] bytes) {
        Message result;
        try {
            if (bytes[0] == REQUEST_TYPE_FIELD_TAG) {
                if (bytes[1] == REQUEST_TYPE_READ) {
                    result = ReadRequest.parseFrom(bytes);
                } else {
                    result = WriteRequest.parseFrom(bytes);
                }
                return result;
            }
        } catch (Throwable ignore) {
        }
        
        // old consistency entity, will be @Deprecated in future
        try {
            GetRequest request = GetRequest.parseFrom(bytes);
            return convertToReadRequest(request);
        } catch (Throwable ignore) {
        }
        
        try {
            Log log = Log.parseFrom(bytes);
            return convertToWriteRequest(log);
        } catch (Throwable ignore) {
        }
        
        throw new ConsistencyException("The current array cannot be serialized to the corresponding object");
    }
@Test
    void testParseWriteRequestWithRequestTypeField() {
        String group = "test";
        ByteString data = ByteString.copyFrom("data".getBytes());
        WriteRequest testCase = WriteRequest.newBuilder().setGroup(group).setData(data).build();
        
        byte[] requestTypeFieldBytes = new byte[2];
        requestTypeFieldBytes[0] = ProtoMessageUtil.REQUEST_TYPE_FIELD_TAG;
        requestTypeFieldBytes[1] = ProtoMessageUtil.REQUEST_TYPE_WRITE;
        
        byte[] dataBytes = testCase.toByteArray();
        ByteBuffer byteBuffer = (ByteBuffer) ByteBuffer.allocate(requestTypeFieldBytes.length + dataBytes.length).put(requestTypeFieldBytes)
                .put(dataBytes).position(0);
        
        Object actual = ProtoMessageUtil.parse(byteBuffer.array());
        assertEquals(WriteRequest.class, testCase.getClass());
        assertEquals(group, ((WriteRequest) actual).getGroup());
        assertEquals(data, ((WriteRequest) actual).getData());
    }