```
 @RequestMapping(value="/portfolios", method = RequestMethod.GET)
    public @ResponseBody List<PortfolioVO>  getPortfolios(HttpServletRequest request, @RequestParam(required= false) String region) {
List<PortfolioVO> portfolios = gmiCacheService.getPortoliosForRegion(user, region);

        return portfolios;      
    }

```

I have another List from another function that I need to add.

to then just return portfolios. I am very new to Java and do not know how to implement this.
['https://Stackoverflow.com/questions/42236697', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7470849/']
Since Java [doesn't have built-in pairs](https://stackoverflow.com/questions/156275/what-is-the-equivalent-of-the-c-pairl-r-in-java), the "Java way" of doing it is to return a custom class that has two `List` fields. Something like:

```
public class MyReturnType{
      public List<PortfolioV0> l1,l2;
}

```

Another option is to return a `List<List<PortfolioV0>>` (a list of lists), and have the first item be the first list, and the second item, the second list.

A third option is to give up, and write your own `Pair` class (or use [Apache's](https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/tuple/Pair.html)), and return a `Pair<List<PortfolioV0>,List<PortfolioV0>>`
I see two ways:

1) return array of lists: `public @ResponseBody List[]<PortfolioVO> getPortfolios( ... )`

inside it: `return new List[] { list1, list2 };`

This is fast to implement, but it is not nice and little bit dirty.

2) More proper way, I think, create class for this case:

```
static class ListPairHolder {
    List<PortfolioVO> list1;
    List<PortfolioVO> list2;

    ListPairHolder(List<PortfolioVO> list1, List<PortfolioVO> list2){
       this.list1 = list1; this.list2 = list2;
    }
}

```

and return this type from method.