Code example for ComparisonFailure

0
  /** 
   * Compares two byte[]s for equality. 
   */ 
  private static void assertEquals(byte[] expected, byte[] actual) {
    if (!Arrays.equals(expected, actual)) {
      throw new ComparisonFailure(null, Arrays.toString(expected),
          Arrays.toString(actual));
    } 
  } 
 
  /** 
   * A RandomAccessFile that can break when you go to write the COMMITTED 
   * status. 
   */ 
  static class BrokenRandomAccessFile extends RandomAccessFile {
    boolean rejectCommit = true;
    BrokenRandomAccessFile(File file, String mode)
        throws FileNotFoundException { 
      super(file, mode);
    } 
    @Override public void write(byte[] buffer) throws IOException {