private void checkSupportForRollingUpgrade(Object ds) {
    KnownVersion[] versions = null;
    if (ds instanceof SerializationVersions) {
      versions = ((SerializationVersions) ds).getSerializationVersions();
    }
    if (versions != null && versions.length > 0) {
      for (final KnownVersion version : versions) {
        if (ds instanceof DataSerializableFixedID) {
          try {
            ds.getClass().getMethod("toDataPre_" + version.getMethodSuffix(),
                DataOutput.class, SerializationContext.class);

            ds.getClass().getMethod("fromDataPre_" + version.getMethodSuffix(),
                DataInput.class, DeserializationContext.class);
          } catch (NoSuchMethodException e) {
            fail(
                "toDataPreXXX or fromDataPreXXX for previous versions not found " + e.getMessage());
          }
        }
        if (ds instanceof DataSerializable) {
          try {
            ds.getClass().getMethod("toDataPre_" + version.getMethodSuffix(),
                DataOutput.class);

            ds.getClass().getMethod("fromDataPre_" + version.getMethodSuffix(),
                DataInput.class);
          } catch (NoSuchMethodException e) {
            fail(
                "toDataPreXXX or fromDataPreXXX for previous versions not found " + e.getMessage());
          }
        }
      }
    } else {
      for (Method method : ds.getClass().getMethods()) {
        if (method.getName().startsWith("toDataPre")) {
          fail(
              "Found backwards compatible toData, but class does not implement getSerializationVersions()"
                  + method);
        } else if (method.getName().startsWith("fromDataPre")) {
          fail(
              "Found backwards compatible fromData, but class does not implement getSerializationVersions()"
                  + method);
        }
      }

    }
  }
Test if all messages implement toDataPreXXX and fromDataPreXXX if the message has been upgraded
in any of the versions
geode-core/src/distributedTest/java/org/apache/geode/internal/BackwardCompatibilitySerializationDUnitTest.java