What I am trying to do here is convert an array to Collection.
How to do this properly?
Here is my array:
PersonList[] personlist = restTemplate.getForObject(url, PersonList[].class);
What I doing there is, I get JSON value and consume with restTemplate, then I put it in PersonList array object, but I want to return the value as Collection. Example:
This is very wrong code that I am trying to present:
Collection<PersonList> personlist2 = personlist
It can't bind the array to collection, cause it's different data type. Can I convert it?
Arrays.asList(personList)