@Test
  public void testMultiUserRootRegions() throws Exception {
    DistributedSystem.connect(createGemFireProperties());
    PoolManager.createFactory().addServer(InetAddress.getLocalHost().getHostName(), 7777)
        .setMultiuserAuthentication(true).create("muPool");
    PoolManager.createFactory().addServer(InetAddress.getLocalHost().getHostName(), 6666)
        .create("suPool");
    ClientCache cc = new ClientCacheFactory().create();
    cc.createClientRegionFactory(PROXY).setPoolName("muPool").create("p");
    cc.createClientRegionFactory(CACHING_PROXY).setPoolName("suPool").create("cp");
    cc.createClientRegionFactory(LOCAL).create("l");
    assertThat(cc.rootRegions().size()).isEqualTo(3);

    {
      Properties muProps = new Properties();
      muProps.setProperty("user", "foo");
      RegionService rs = cc.createAuthenticatedView(muProps, "muPool");
      assertThat(rs.getRegion("p")).isNotNull();
      assertThatThrownBy(() -> rs.getRegion("cp")).isInstanceOf(IllegalStateException.class);
      assertThatThrownBy(() -> rs.getRegion("l")).isInstanceOf(IllegalStateException.class);
      assertThat(rs.rootRegions().size()).isEqualTo(1);
      assertThat(rs.getRegion("p")).isInstanceOf(ProxyRegion.class);
      assertThat(rs.rootRegions().iterator().next()).isInstanceOf(ProxyRegion.class);
    }
  }
Unit test for the ClientRegionFactory class

@since GemFire 6.5
geode-core/src/integrationTest/java/org/apache/geode/cache/client/ClientRegionFactoryJUnitTest.java