### Question:
Rost { public static ArrayList<String> result(int num) { ArrayList<String> results = new ArrayList<>(); for (int i = 1; i <= num; i++) { String print = ""; if (i % 3 == 0) { print = print.concat("Fizz"); } if (i % 5 == 0) { print = print.concat("Buzz"); } if (i % 7 == 0) { print = print.concat("Bazz"); } if ("".equals(print)) { print = String.valueOf(i); } results.add(print); } return results; }  static void main(String[] args); static ArrayList<String> result(int num);  }### Answer:
@Test public void result(int cap) { ArrayList<String> test = Rost.result(cap); try { for (String line : test) { int num = test.indexOf(line) + 1; if (num % 3 == 0 && num % 5 == 0 && num % 7 == 0) { assertEquals("FizzBuzzBazz", line); } else if (num % 3 == 0 && num % 5 == 0) { assertEquals("FizzBuzz", line); } else if (num % 3 == 0 && num % 7 == 0) { assertEquals("FizzBazz", line); } else if (num % 5 == 0 && num % 7 == 0) { assertEquals("BuzzBazz", line); } else if (num % 3 == 0) { assertEquals("Fizz", line); } else if (num % 5 == 0) { assertEquals("Buzz", line); } else if (num % 7 == 0) { assertEquals("Bazz", line); } else { assertEquals(String.valueOf(num), line); } } } catch (ComparisonFailure e) { System.out.printf("Test failed: %s\n", e); return; } System.out.println("Test passed"); }