Unfortunately the standard JsonArrayBuilder does not take a list as input. So you will need to iterate over the list.
I don't know how your List looks but you could make a function like:
public JsonArray createJsonArrayFromList(List<Person> list) {
JsonArray jsonArray = Json.createArrayBuilder();
for(Person person : list) {
jsonArray.add(Json.createObjectBuilder()
.add("firstname", person.getFirstName())
.add("lastname", person.getLastName()));
}
jsonArray.build();
return jsonArray;
}