@Test public void testNullArraysNotEqual() throws InterruptedException { String[] instance = null; String[] copy = new String[]{"asd"}; Assert.assertTrue(!CompareUtil.compareArraysAndNull(instance, copy)); }
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; } }
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; } } }
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; } }  }
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); }
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);  }