@SuppressWarnings("JavaReflectionMemberAccess")
  private SerializableRunnableIF createRequestResponseFunction(
      final int locatorPort,
      final String requestClassName,
      final String responseClassName) {

    return () -> {

      final Class<?> requestClass = Class.forName(requestClassName);
      final Object requestMessage = requestClass.newInstance();

      final TcpClient tcpClient;
      if (versions.clientProductVersion.greaterThanOrEqualTo(FIRST_NEW_VERSION)) {
        tcpClient = getTcpClient();
      } else {
        tcpClient = getLegacyTcpClient();
      }

      @SuppressDeprecationForBackwardsCompatibilityTesting
      @SuppressWarnings("deprecation")
      final InetAddress localHost = SocketCreator.getLocalHost();
      Object response;
      try {
        Method requestToServer =
            TcpClient.class.getMethod("requestToServer", InetAddress.class, int.class, Object.class,
                int.class);
        response = requestToServer.invoke(tcpClient, localHost, locatorPort,
            requestMessage, 1000);
      } catch (NoSuchMethodException e) {
        response =
            tcpClient.requestToServer(new HostAndPort(localHost.getHostAddress(), locatorPort),
                requestMessage, 1000, true);
      }

      final Class<?> responseClass = Class.forName(responseClassName);

      assertThat(response).isInstanceOf(responseClass);
    };

  }
In version 1.12 TcpServer changed: the three pairs of message types used to derive from
DataSerializable, but as of 1.12 they derive from BasicSerializable.

This test verifies that the current version (1.12 or later) is compatible with the latest
version before 1.12
geode-tcp-server/src/upgradeTest/java/org/apache/geode/distributed/internal/tcpserver/TcpServerProductVersionUpgradeTest.java