@Override
  public boolean equals(final Object obj) {
    if (this == obj) {
      return true;
    }

    if (!(obj instanceof PartitionAttributesImpl)) {
      return false;
    }

    PartitionAttributesImpl other = (PartitionAttributesImpl) obj;

    if (redundancy != other.getRedundantCopies()
        || getLocalMaxMemory() != other.getLocalMaxMemory() || offHeap != other.getOffHeap()
        || totalNumBuckets != other.getTotalNumBuckets()
        || totalMaxMemory != other.getTotalMaxMemory()
        || startupRecoveryDelay != other.getStartupRecoveryDelay()
        || recoveryDelay != other.getRecoveryDelay()
        || ((partitionResolver == null) != (other.getPartitionResolver() == null))
        || (partitionResolver != null
            && !partitionResolver.equals(other.getPartitionResolver()))
        || ((colocatedRegionName == null) != (other.getColocatedWith() == null))
        || (colocatedRegionName != null
            && !colocatedRegionName.equals(other.getColocatedWith()))
        || ((fixedPAttrs == null) != (other.getFixedPartitionAttributes() == null))
        || (fixedPAttrs != null
            && !fixedPAttrs.equals(other.getFixedPartitionAttributes()))) {
      return false;
    }

    PartitionListener[] otherPListeners = other.getPartitionListeners();
    PartitionListener[] thisPListeners = getPartitionListeners();

    if (otherPListeners.length != thisPListeners.length) {
      return false;
    }
    Set<String> otherListenerClassName = new HashSet<>();
    for (PartitionListener listener : otherPListeners) {
      otherListenerClassName.add(listener.getClass().getName());
    }
    Set<String> thisListenerClassName = new HashSet<>();
    for (PartitionListener listener : thisPListeners) {
      thisListenerClassName.add(listener.getClass().getName());
    }
    return thisListenerClassName.equals(otherListenerClassName);
  }
@throws IllegalStateException if off-heap and the actual value is not yet known (because the
        DistributedSystem has not yet been created)
geode-core/src/main/java/org/apache/geode/internal/cache/PartitionAttributesImpl.java