private static JsonArray toPayload(Object ... parameters) {
JsonArray result = new JsonArray();
for (Object param: parameters) {
if (param instanceof JsonArray) {
param = ((JsonArray) param).getList();
<BUG>}
if (param instanceof Collection) {</BUG>
((Collection) param).stream().filter(el -> el != null).forEach(result::add);
} else if (param instanceof Map) {
for (Map.Entry<?, ?> pair : ((Map<?, ?>) param).entrySet()) {

private static JsonArray toPayload(Object ... parameters) {
JsonArray result = new JsonArray();
for (Object param: parameters) {
if (param instanceof JsonArray) {
param = ((JsonArray) param).getList();
}
if (param instanceof JsonObject) {
param = ((JsonObject) param).getMap();
}
if (param instanceof Collection) {
((Collection) param).stream().filter(el -> el != null).forEach(result::add);
} else if (param instanceof Map) {
for (Map.Entry<?, ?> pair : ((Map<?, ?>) param).entrySet()) {
