apache-geode-extensions/src/main/java/org/springframework/geode/util/CacheUtils.java
/**
	 * Null-safe method to determine whether the given {@link RegionService} is an instance of
	 * a {@literal peer} {@link Cache}.
	 *
	 * The problem is, {@link GemFireCacheImpl} implements both the (peer) {@link Cache}
	 * and {@link ClientCache} interfaces. #sigh
	 *
	 * @param regionService {@link RegionService} to evaluate.
	 * @return a boolean value indicating whether the {@link RegionService} is an instance of
	 * a {@literal peer} {@link Cache}.
	 * @see org.apache.geode.cache.RegionService
	 * @see org.apache.geode.cache.Cache
	 */
Null-safe method to determine whether the given  RegionService is an instance of
a  peer  Cache.

The problem is,  GemFireCacheImpl implements both the (peer)  Cache
and  ClientCache interfaces. #sigh

@param regionService  RegionService to evaluate.
@return a boolean value indicating whether the  RegionService is an instance of
a  peer  Cache.
Null - safe method to determine whether the given RegionService is an instance of a peer Cache . The problem is GemFireCacheImpl implements both the ( peer ) Cache and ClientCache interfaces . #sigh @param regionService RegionService to evaluate . @return a boolean value indicating whether the RegionService is an instance of a peer Cache .
public static boolean isPeerCache(RegionService regionService) {
		boolean result = regionService instanceof Cache;
		if (regionService instanceof GemFireCacheImpl) {
			result &= !((GemFireCacheImpl) regionService).isClient();
		}
		return result;
	}
public static boolean isPeerCache ( RegionService regionService ) { boolean result = regionService instanceof Cache ; if ( regionService instanceof GemFireCacheImpl ) { result &= ! ( ( GemFireCacheImpl ) regionService ) . isClient ( ) ; } return result ; }
Null-safe method to determine whether the given {@link RegionService} is an instance of
 a {@literal peer} {@link Cache}.
Null - safe method to determine whether the given { @link RegionService } is an instance of a { @literal peer } { @link Cache } .