### Question:
FunctionApp { public static JsonObject main(JsonObject args) { JsonObject response = new JsonObject(); List<String> upperStrings = new ArrayList<>(); if (args.has("result")) { args.getAsJsonArray("result").forEach(e -> upperStrings.add(e.getAsString())); } JsonArray sortedArray = new JsonArray(); upperStrings.stream().sorted(Comparator.naturalOrder()).forEach(s -> sortedArray.add(s)); response.add("result", sortedArray); return response; }  static JsonObject main(JsonObject args);  }### Answer:
@Test public void testFunction() { JsonObject args = new JsonObject(); JsonArray splitStrings = new JsonArray(); splitStrings.add("APPLE"); splitStrings.add("ORANGE"); splitStrings.add("BANANA"); args.add("result", splitStrings); JsonObject response = FunctionApp.main(args); assertNotNull(response); JsonArray results = response.getAsJsonArray("result"); assertNotNull(results); assertEquals(3, results.size()); List<String> actuals = new ArrayList<>(); results.forEach(j -> actuals.add(j.getAsString())); assertTrue(actuals.get(0).equals("APPLE")); assertTrue(actuals.get(1).equals("BANANA")); assertTrue(actuals.get(2).equals("ORANGE")); }