public static void assertFileEqualsFile(File expected, File actual) {
        if (expected == null || !expected.exists())
            fail("Expected file doesn't exist");
        if (actual == null || !actual.exists())
            fail("Actual file doesn't exist");

        final long expectedFileLen = expected.length();
        final long fileLen = actual.length();
        Assert.assertTrue("expectedFileLen=" + expectedFileLen + ", fileLen=" + fileLen + ", expectedFile=" + expected
                + ", file=" + actual, expectedFileLen == fileLen);
        try {
            assertStreamEqualsStream("expected file: " + expected + " vs. actual file: " + actual,
                    new FileInputStream(expected), new FileInputStream(actual));
        } catch (Exception e) {
            fail("Unable to compare files: " + e.getMessage());
        }
    }
Asserts that the contents of the two files are same.

@param expected
           expected file.
@param actual
           actual file.
aws-java-sdk-test-utils/src/main/java/com/amazonaws/test/util/SdkAsserts.java