Afterwards, compare the two files to check if everything looks exactly the same.
Here I just ignore all exceptions, because I don’t really care about the errors.
That is only OK because this is an inconsequential demo application.
try {
byte[] input = Files.readAllBytes(Path.of("demo_tracks.csv"));
byte[] output = Files.readAllBytes(Path.of("output.csv"));
if (!Arrays.equals(input, output)) {
System.out.println("CSV output should be exactly equal to input!");
}
} catch (Exception ignored) {
}
}
}