@Override
    public boolean equals(Object obj) {
      if (this == obj) {
        return true;
      }
      if (obj == null) {
        return false;
      }
      if (getClass() != obj.getClass()) {
        return false;
      }
      PrimitiveObjectHolder other = (PrimitiveObjectHolder) obj;
      if (b == null) {
        if (other.b != null) {
          return false;
        }
      } else if (!b.equals(other.b)) {
        return false;
      }
      if (bool == null) {
        if (other.bool != null) {
          return false;
        }
      } else if (!bool.equals(other.bool)) {
        return false;
      }
      if (c == null) {
        if (other.c != null) {
          return false;
        }
      } else if (!c.equals(other.c)) {
        return false;
      }
      if (d == null) {
        if (other.d != null) {
          return false;
        }
      } else if (!d.equals(other.d)) {
        return false;
      }
      if (f == null) {
        if (other.f != null) {
          return false;
        }
      } else if (!f.equals(other.f)) {
        return false;
      }
      if (i == null) {
        if (other.i != null) {
          return false;
        }
      } else if (!i.equals(other.i)) {
        return false;
      }
      if (l == null) {
        if (other.l != null) {
          return false;
        }
      } else if (!l.equals(other.l)) {
        return false;
      }
      if (s == null) {
        return other.s == null;
      } else
        return s.equals(other.s);
    }
A serializable with a writeReplace method should use standard serialization.
geode-core/src/integrationTest/java/org/apache/geode/pdx/AutoSerializableJUnitTest.java