private int createServer() throws IOException {
    CacheServer server = null;
    Properties p = new Properties();
    // make it a loner
    p.put(MCAST_PORT, "0");
    p.put(LOCATORS, "");
    system = DistributedSystem.connect(p);
    cache = CacheFactory.create(system);
    server = cache.addCacheServer();
    int port = getRandomAvailableTCPPort();
    server.setMaxConnections(MAX_CNXS);
    server.setMaxThreads(getMaxThreads());
    server.setPort(port);
    server.start();
    return server.getPort();
  }
Creates and starts the server instance
geode-core/src/integrationTest/java/org/apache/geode/internal/cache/tier/sockets/CacheServerMaxConnectionsJUnitTest.java