### Question:
CompareUtil { public static boolean compareArraysAndNull(Object[] arg1, Object[] arg2) { if (arg1 == null && arg2 == null) { return true; } else if ((arg1 == null && arg2 != null) || (arg1 != null && arg2 == null) || arg1.length != arg2.length) { return false; } else { for (int i = 0; i < arg1.length; i++) { if (!compareObjectsAndNull(arg1[i], arg2[i])) { return false; } } return true; } }  static boolean compareObjectsAndNull(Object object1, Object object2); static boolean compareArraysAndNull(Object[] arg1, Object[] arg2); static boolean compareListsAndNull(List arg1, List arg2);  }### Answer:
@Test public void testNullArraysEqual() throws InterruptedException { String[] instance = null; String[] copy = null; Assert.assertTrue(CompareUtil.compareArraysAndNull(instance, copy)); }
@Test public void testNullArraysNotEqual() throws InterruptedException { String[] instance = null; String[] copy = new String[]{"asd"}; Assert.assertTrue(!CompareUtil.compareArraysAndNull(instance, copy)); }
@Test public void testArraysEqual() throws InterruptedException { String[] instance = new String[]{"asd"};; String[] copy = new String[]{"asd"}; Assert.assertTrue(CompareUtil.compareArraysAndNull(instance, copy)); }
@Test public void testArraysNotEqual() throws InterruptedException { String[] instance = new String[]{"asd", "asd2"};; String[] copy = new String[]{"asd"}; Assert.assertTrue(!CompareUtil.compareArraysAndNull(instance, copy)); }