CacheClientProxyFactory { public CacheClientProxy create(CacheClientNotifier notifier, Socket socket, ClientProxyMembershipID proxyId, boolean isPrimary, byte clientConflation, KnownVersion clientVersion, long acceptorId, boolean notifyBySubscription, SecurityService securityService, Subject subject, StatisticsClock statisticsClock) throws CacheException { return internalFactory.create(notifier, socket, proxyId, isPrimary, clientConflation, clientVersion, acceptorId, notifyBySubscription, securityService, subject, statisticsClock); } CacheClientProxyFactory(); private  CacheClientProxyFactory(InternalCacheClientProxyFactory internalFactory); CacheClientProxy create(CacheClientNotifier notifier, Socket socket,
      ClientProxyMembershipID proxyId, boolean isPrimary, byte clientConflation,
      KnownVersion clientVersion, long acceptorId, boolean notifyBySubscription,
      SecurityService securityService, Subject subject, StatisticsClock statisticsClock); @Immutable
  @VisibleForTesting
  static final String INTERNAL_FACTORY_PROPERTY; }
@Test public void createsCacheClientProxyByDefault() { CacheClientProxyFactory factory = new CacheClientProxyFactory(); CacheClientProxy proxy = factory.create(notifier, socket, proxyId, false, CONFLATION_DEFAULT, clientVersion, 0, false, securityService, subject, statisticsClock); assertThat(proxy).isExactlyInstanceOf(CacheClientProxy.class); }
@Test public void usesCustomInternalFactorySpecifiedByProperty() { System.setProperty(CacheClientProxyFactory.INTERNAL_FACTORY_PROPERTY, SubCacheClientProxyFactory.class.getName()); CacheClientProxyFactory factory = new CacheClientProxyFactory(); CacheClientProxy proxy = factory.create(notifier, socket, proxyId, false, CONFLATION_DEFAULT, clientVersion, 0, false, securityService, subject, statisticsClock); assertThat(proxy).isExactlyInstanceOf(SubCacheClientProxy.class); }