Source:
<code>public void arrayEquals(String message, Object expecteds, Object actuals) throws ArrayComparisonFailure { if (expecteds == actuals || Arrays.deepEquals(new Object[] {expecteds}, new Object[] {actuals})) { return; } String header = message == null ? "" : message + ": "; if (expecteds == null) { Assert.fail(header + "expected array was null"); } if (actuals == null) { Assert.fail(header + "actual array was null"); } int actualsLength = Array.getLength(actuals); int expectedsLength = Array.getLength(expecteds); if (actualsLength != expectedsLength) { header = header + "array lengths differed, expected.length=" + expectedsLength + " actual.length=" + actualsLength + "; "; } int prefixLength = Math.min(actualsLength, expectedsLength); for (int i = 0; i < prefixLength; i++) { Object expected = Array.get(expecteds, i); Object actual = Array.get(actuals, i); if (isArray(expected) && isArray(actual)) { try { arrayEquals(message, expected, actual); } catch (ArrayComparisonFailure e) { e.addDimension(i); throw e; } } else { try { assertElementsEqual(expected, actual); } catch (AssertionError e) { throw new ArrayComparisonFailure(header, e, i); } } } if (actualsLength != expectedsLength) { Object expected = getArrayElementOrSentinel(expecteds, expectedsLength, prefixLength); Object actual = getArrayElementOrSentinel(actuals, actualsLength, prefixLength); try { <START> Assert.assertEquals(expected, actual); <END> } catch (AssertionError e) { throw new ArrayComparisonFailure(header, e, prefixLength); } } }</code><technical_language>previous code Assert.fail() here. reason do different? I recall this code a bit sensitive handling nested arrays</technical_language>

Target:
public void arrayEquals(String message, Object expecteds, Object actuals) throws ArrayComparisonFailure { if (expecteds == actuals || Arrays.deepEquals(new Object[] {expecteds}, new Object[] {actuals})) { return; } String header = message == null ? "" : message + ": "; if (expecteds == null) { Assert.fail(header + "expected array was null"); } if (actuals == null) { Assert.fail(header + "actual array was null"); } int actualsLength = Array.getLength(actuals); int expectedsLength = Array.getLength(expecteds); if (actualsLength != expectedsLength) { header = header + "array lengths differed, expected.length=" + expectedsLength + " actual.length=" + actualsLength + "; "; } int prefixLength = Math.min(actualsLength, expectedsLength); for (int i = 0; i < prefixLength; i++) { Object expected = Array.get(expecteds, i); Object actual = Array.get(actuals, i); if (isArray(expected) && isArray(actual)) { try { arrayEquals(message, expected, actual); } catch (ArrayComparisonFailure e) { e.addDimension(i); throw e; } } else { try { assertElementsEqual(expected, actual); } catch (AssertionError e) { throw new ArrayComparisonFailure(header, e, i); } } } if (actualsLength != expectedsLength) { Object expected = getToStringableArrayElement(expecteds, expectedsLength, prefixLength); Object actual = getToStringableArrayElement(actuals, actualsLength, prefixLength); try { Assert.assertEquals(expected, actual); } catch (AssertionError e) { throw new ArrayComparisonFailure(header, e, prefixLength); } } }