What is the easiest way to check (in a unit test) whether binary files A and B are equal?
Since Java 12 you could also use the Files.mismatch method JavaDoc. It will return -1L if the files are the same.
Files.mismatch
-1L