@Test public void testNewUser() { ClientRESTHandler clientRESTHandler = new ClientRESTHandler(); long id = clientRESTHandler.createNewUserID(); long id2 = clientRESTHandler.createNewUserID(); assertThat(id).isNotEqualTo(id2); assertThat(id).isLessThan(id2); }
@POST @Path("new") @Produces(MediaType.TEXT_PLAIN) public synchronized long createNewUserID() { logger.info("New client registered"); return ManagerRegistry.getClientManager().newClient(); }
ClientRESTHandler { @POST @Path("new") @Produces(MediaType.TEXT_PLAIN) public synchronized long createNewUserID() { logger.info("New client registered"); return ManagerRegistry.getClientManager().newClient(); } }
ClientRESTHandler { @POST @Path("new") @Produces(MediaType.TEXT_PLAIN) public synchronized long createNewUserID() { logger.info("New client registered"); return ManagerRegistry.getClientManager().newClient(); }  }
ClientRESTHandler { @POST @Path("new") @Produces(MediaType.TEXT_PLAIN) public synchronized long createNewUserID() { logger.info("New client registered"); return ManagerRegistry.getClientManager().newClient(); }  @POST @Path("new") @Produces(MediaType.TEXT_PLAIN) synchronized long createNewUserID(); }
ClientRESTHandler { @POST @Path("new") @Produces(MediaType.TEXT_PLAIN) public synchronized long createNewUserID() { logger.info("New client registered"); return ManagerRegistry.getClientManager().newClient(); }  @POST @Path("new") @Produces(MediaType.TEXT_PLAIN) synchronized long createNewUserID();  }