private static TestAndSetCondition fromProtoTasCondition(DocapiFeed.TestAndSetCondition protoTasCond) {
        // Note: empty (default) string and (default) required persistence timestamp of 0 implies "no condition present"
        if (!protoTasCond.getSelection().isEmpty()) {
            if (protoTasCond.getRequiredTimestamp() != 0) {
                return TestAndSetCondition.ofRequiredTimestampWithSelectionFallback(
                        protoTasCond.getRequiredTimestamp(),
                        protoTasCond.getSelection());
            }
            return new TestAndSetCondition(protoTasCond.getSelection());
        } else if (protoTasCond.getRequiredTimestamp() != 0) {
            return TestAndSetCondition.ofRequiredTimestamp(protoTasCond.getRequiredTimestamp());
        }
        return TestAndSetCondition.NOT_PRESENT_CONDITION;
    }
Implementation of MessageBus message request/response serialization built around Protocol Buffers.
documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/RoutableFactories80.java