public static RegionAttributes createRegionAttrsForPR(int red, int localMaxMem,
      long recoveryDelay, EvictionAttributes evictionAttrs, PartitionResolver resolver) {

    AttributesFactory attr = new AttributesFactory();
    attr.setDataPolicy(DataPolicy.PARTITION);
    PartitionAttributesFactory paf = new PartitionAttributesFactory();
    paf.setRedundantCopies(red).setLocalMaxMemory(localMaxMem).setRecoveryDelay(recoveryDelay);
    if (resolver != null) {
      paf.setPartitionResolver(resolver);
    }
    PartitionAttributes<?, ?> prAttr = paf.create();
    attr.setPartitionAttributes(prAttr);
    attr.setEvictionAttributes(evictionAttrs);
    return attr.create();
  }
This function creates Region attributes with provided scope,redundancy and localmaxMemory
geode-junit/src/main/java/org/apache/geode/internal/cache/PartitionedRegionTestHelper.java