UserService { public List<User> getAllUsers() { Query<Entity> query = Query.newGqlQueryBuilder(Query.ResultType.ENTITY, "SELECT * FROM " + kind).build(); QueryResults<Entity> results = datastore.run(query); List<User> users = new ArrayList<>(); while (results.hasNext()) { Entity result = results.next(); users.add( new User(result.getString("id"), result.getString("name"), result.getString("email"))); } return users; } UserService(Datastore datastore, String kind); List<User> getAllUsers(); User createUser(String name, String email); String deleteUser(String id); User updateUser(String id, String name, String email);  }
@Test public void testGetAllUsers() { List<User> allUsers = USER_SERVICE.getAllUsers(); assertEquals(1, allUsers.size()); User actualUser = allUsers.get(0); assertEquals(USER.getId(), actualUser.getId()); assertEquals(USER.getName(), actualUser.getName()); assertEquals(USER.getEmail(), actualUser.getEmail()); }