UserDAO { public User create(String name, String pwd, String mail) { User user = new User(); user.setFullname(name); user.setPassword(pwd); user.setEmail(mail); return dao.create(user); }  User create(String name, String pwd, String mail); List<User> list(int first, int max); User find(long id); void delete(long id); User update(long id, String name, String pwd, String mail);  }
@Test public void create() throws NamingException { UserDAO dao = (UserDAO) container.getContext().lookup("java:global/rest-example/UserDAO"); User user = dao.create("foo", "dummy", "foo@bar.org"); assertNotNull(dao.find(user.getId())); }