Source:
<code>private void startCacheServer(VM server, final int port, final boolean disableQueryMonitorForLowMemory, final int queryTimeout, final boolean createPR) { server.invoke(() -> { getSystem(getServerProperties()); if (disableQueryMonitorForLowMemory) { System.setProperty( GeodeGlossary.GEMFIRE_PREFIX + "Cache.DISABLE_QUERY_MONITOR_FOR_LOW_MEMORY", "true"); } else { System.clearProperty( GeodeGlossary.GEMFIRE_PREFIX + "Cache.DISABLE_QUERY_MONITOR_FOR_LOW_MEMORY"); } GemFireCacheImpl cache = (GemFireCacheImpl) getCache(); cache.MAX_QUERY_EXECUTION_TIME = queryTimeout; InternalResourceManager resourceManager = (InternalResourceManager) cache.getResourceManager(); HeapMemoryMonitor heapMonitor = resourceManager.getHeapMonitor(); heapMonitor.setTestMaxMemoryBytes(1000); HeapMemoryMonitor.setTestBytesUsedForThresholdSet(NORMAL_HEAP_USED); resourceManager.setCriticalHeapPercentage(85); RegionFactory<String, Portfolio> factory = cache.createRegionFactory(); if (createPR) { PartitionAttributesFactory paf = new PartitionAttributesFactory(); paf.setRedundantCopies(0); paf.setTotalNumBuckets(11); factory.setPartitionAttributes(paf.create()); } else { factory.setScope(Scope.DISTRIBUTED_ACK); factory.setDataPolicy(DataPolicy.REPLICATE); } Region region = createRootRegion("portfolios", factory); if (createPR) { <START> assertThat(region instanceof PartitionedRegion).isTrue(); <END> } else { assertThat(region instanceof DistributedRegion).isTrue(); } CacheServer cacheServer = getCache().addCacheServer(); cacheServer.setPort(port); cacheServer.start(); return null; }); }</code><technical_language>Or: assertThat(region).isInstanceOf(PartitionedRegion.class); I delete this if-else block assertions worthless</technical_language>

Target:
private void startCacheServer(VM server, final int port, final boolean disableQueryMonitorForLowMemory, final int queryTimeout, final boolean createPR) { server.invoke(() -> { getSystem(getServerProperties()); if (disableQueryMonitorForLowMemory) { System.setProperty( GeodeGlossary.GEMFIRE_PREFIX + "Cache.DISABLE_QUERY_MONITOR_FOR_LOW_MEMORY", "true"); } else { System.clearProperty( GeodeGlossary.GEMFIRE_PREFIX + "Cache.DISABLE_QUERY_MONITOR_FOR_LOW_MEMORY"); } GemFireCacheImpl cache = (GemFireCacheImpl) getCache(); cache.MAX_QUERY_EXECUTION_TIME = queryTimeout; InternalResourceManager resourceManager = (InternalResourceManager) cache.getResourceManager(); HeapMemoryMonitor heapMonitor = resourceManager.getHeapMonitor(); heapMonitor.setTestMaxMemoryBytes(1000); HeapMemoryMonitor.setTestBytesUsedForThresholdSet(NORMAL_HEAP_USED); resourceManager.setCriticalHeapPercentage(85); RegionFactory<String, Portfolio> factory = cache.createRegionFactory(); if (createPR) { PartitionAttributesFactory paf = new PartitionAttributesFactory(); paf.setRedundantCopies(0); paf.setTotalNumBuckets(11); factory.setPartitionAttributes(paf.create()); } else { factory.setScope(Scope.DISTRIBUTED_ACK); factory.setDataPolicy(DataPolicy.REPLICATE); } Region<String, Portfolio> region = createRootRegion("portfolios", factory); if (createPR) { assertThat(region).isInstanceOf(PartitionedRegion.class); } else { assertThat(region).isInstanceOf(DistributedRegion.class); } CacheServer cacheServer = getCache().addCacheServer(); cacheServer.setPort(port); cacheServer.start(); return null; }); }