@Test
  public void testClientProtocolVersion() {
    int serverPort = initServerCache(true);
    VM client1 = Host.getHost(0).getVM(clientVmConfiguration, 1);
    String hostname = NetworkUtils.getServerHostName();
    short ordinal = client1.invoke("create client1 cache", () -> {
      createClientCache(hostname, serverPort);
      populateCache();
      registerInterest();
      InternalDistributedMember distributedMember = (InternalDistributedMember) static_cache
          .getDistributedSystem().getDistributedMember();
      // older versions of Geode have a different Version class so we have to use reflection here
      try {
        Method getter = InternalDistributedMember.class.getMethod("getVersionObject");
        Object versionObject = getter.invoke(distributedMember);
        Method getOrdinal = versionObject.getClass().getMethod("ordinal");
        return (Short) getOrdinal.invoke(versionObject);
      } catch (NoSuchMethodException ignore) {
      }
      // newer versions can be accessed directly
      return distributedMember.getVersionOrdinal();
    });
    short protocolOrdinal = server1.invoke("fetch client's protocol version",
        () -> CacheClientNotifier.getInstance().getClientProxies()
            .iterator().next().getVersion().ordinal());
    KnownVersion clientProductVersion = Versioning.getKnownVersionOrDefault(
        Versioning.getVersion(ordinal), null);
    KnownVersion clientProtocolVersion = Versioning.getKnownVersionOrDefault(
        Versioning.getVersion(protocolOrdinal), null);
    assertThat(clientProductVersion.getClientServerProtocolVersion())
        .isEqualTo(clientProtocolVersion);
  }
A client should advertise its protocol version, which may not be the same
as its product version.
geode-cq/src/upgradeTest/java/org/apache/geode/internal/cache/tier/sockets/ClientServerMiscBCDUnitTest.java