private void validateColocatedWith(final PartitionRegionConfig prconf,
      final PartitionAttributes userPA) {
    if (userPA.getColocatedWith() == null && prconf.getColocatedWith() != null) {
      throw new IllegalStateException(
          String.format(
              "The colocatedWith=%s found in PartitionAttributes is incompatible with the colocatedWith=%s used by other distributed members.",
              "null", prconf.getColocatedWith()));

    }
    if (userPA.getColocatedWith() != null && prconf.getColocatedWith() != null) {
      if (!(prconf.getColocatedWith().equals(userPA.getColocatedWith()))) {
        throw new IllegalStateException(
            String.format(
                "The colocatedWith=%s found in PartitionAttributes is incompatible with the colocatedWith=%s used by other distributed members.",

                userPA.getColocatedWith(), prconf.getColocatedWith()));
      }
    }
  }
This method validates the PartitionedAttributes that user provided PR Attributes with PR
Attributes set in PR Config obtained from global meta-data allPartitionedRegion region
geode-core/src/main/java/org/apache/geode/internal/cache/PartitionRegionConfigValidator.java