### Question:
AtomixAgent { public static void main(String[] args) throws Exception { final List<String> unknown = new ArrayList<>(); final Namespace namespace = parseArgs(args, unknown); final Namespace extraArgs = parseUnknown(unknown); extraArgs.getAttrs().forEach((key, value) -> System.setProperty(key, value.toString())); final Logger logger = createLogger(namespace); final Atomix atomix = buildAtomix(namespace); atomix.start().join(); logger.info("Atomix listening at {}", atomix.getMembershipService().getLocalMember().address()); final ManagedRestService rest = buildRestService(atomix, namespace); rest.start().join(); logger.warn("The Atomix HTTP API is BETA and is intended for development and debugging purposes only!"); logger.info("HTTP server listening at {}", rest.address()); synchronized (Atomix.class) { while (atomix.isRunning()) { Atomix.class.wait(); } } }  static void main(String[] args);  }### Answer:
@Test @Ignore public void testFormCluster() throws Exception { String path = getClass().getClassLoader().getResource("test.conf").getPath(); Thread thread1 = new Thread(() -> { try { AtomixAgent.main(new String[]{"-m", "node1", "-a", "localhost:5000", "-c", path, "-p", "6000"}); } catch (Exception e) { e.printStackTrace(); Thread.currentThread().interrupt(); } }); Thread thread2 = new Thread(() -> { try { AtomixAgent.main(new String[]{"-m", "node2", "-a", "localhost:5001", "-c", path, "-p", "6001"}); AtomixAgent.main(new String[]{"node2@localhost:5001", "-c", path}); } catch (Exception e) { e.printStackTrace(); Thread.currentThread().interrupt(); } }); Thread thread3 = new Thread(() -> { try { AtomixAgent.main(new String[]{"-m", "node3", "-a", "localhost:5002", "-c", path, "-p", "6002"}); } catch (Exception e) { e.printStackTrace(); Thread.currentThread().interrupt(); } }); thread1.start(); thread2.start(); thread3.start(); Thread.sleep(5000); Atomix client1 = Atomix.builder(path) .withMemberId("client1") .withHost("localhost") .withPort(5003) .build(); client1.start().join(); Atomix client2 = Atomix.builder(path) .withMemberId("client2") .withHost("localhost") .withPort(5004) .build(); client2.start().join(); AtomicMap<String, String> map1 = client1.getAtomicMap("test"); AtomicMap<String, String> map2 = client2.getAtomicMap("test"); map1.put("foo", "bar"); assertEquals("bar", map2.get("foo").value()); thread1.interrupt(); thread2.interrupt(); thread3.interrupt(); }