public static SimpleTurmsNotification parseSimpleNotification(
            CodedInputStream turmsRequestInputStream) {
        Assert.notNull(turmsRequestInputStream, "The input stream must not be null");
        // The CodedInputStream.newInstance is efficient because it reuses the direct buffer
        try {
            long requesterId = UNSET_VALUE;
            Integer closeStatus = null;
            TurmsRequest.KindCase type = null;
            boolean done = false;
            while (!done) {
                int tag = turmsRequestInputStream.readTag();
                switch (tag) {
                    case REQUESTER_ID_TAG -> {
                        if (requesterId == UNSET_VALUE) {
                            requesterId = turmsRequestInputStream.readInt64();
                        } else {
                            throw ResponseException.get(ResponseStatusCode.ILLEGAL_ARGUMENT,
                                    "Not a valid notification: Duplicate requester ID");
                        }
                    }
                    case CLOSE_STATUS_TAG -> {
                        if (closeStatus == null) {
                            closeStatus = turmsRequestInputStream.readInt32();
                        } else {
                            throw ResponseException.get(ResponseStatusCode.ILLEGAL_ARGUMENT,
                                    "Not a valid notification: Duplicate close status");
                        }
                    }
                    case RELAYED_REQUEST_TAG -> {
                        turmsRequestInputStream.readRawVarint32();
                        int i = turmsRequestInputStream.readTag();
                        int kindFieldNumber = WireFormat.getTagFieldNumber(i);
                        type = TurmsRequest.KindCase.forNumber(kindFieldNumber);
                        done = true;
                    }
                    default -> turmsRequestInputStream.skipField(tag);
                }
            }
            if (requesterId == UNSET_VALUE) {
                throw ResponseException.get(ResponseStatusCode.ILLEGAL_ARGUMENT,
                        "Not a valid notification: No requester ID");
            }
            if (type == null || type == KIND_NOT_SET) {
                throw ResponseException.get(ResponseStatusCode.ILLEGAL_ARGUMENT,
                        "Not a valid notification: Unknown request type: "
                                + type);
            }
            return new SimpleTurmsNotification(requesterId, closeStatus, type);
        } catch (IOException e) {
            throw ResponseException.get(ResponseStatusCode.ILLEGAL_ARGUMENT,
                    "Not a valid notification: "
                            + e.getMessage());
        }
    }
{@link im.turms.server.common.access.client.dto.notification.TurmsNotification:87}
turms-gateway/src/main/java/im/turms/gateway/infra/proto/TurmsNotificationParser.java