Code example for ArrayList

Methods: add, addAll

0
 
    @Override 
    public List<User> request() throws IOException {
        User user = userService.getUser();
        List<User> orgs = orgService.getOrganizations();
        List<User> all = new ArrayList<User>(orgs.size() + 1);
        all.add(user);
        all.addAll(orgs);
        return all;
    } 
}