### Question:
ByteArrayDiffs { public static byte[] diff(byte[] orig, byte[] target) { MemoryDiff md = new MemoryDiff(); md.store(Diffs.improved(Diffs.queue(orig, target))); return Serials.serialize(DefaultSerialization.newInstance(), MemoryDiff.class, md); } private  ByteArrayDiffs(); static byte[] diff(byte[] orig, byte[] target); static byte[] apply(byte[] orig, byte[] diff); static byte[] udiff(byte[] orig, byte[] target); static byte[] undo(byte[] target, byte[] diff); static byte[] udiff(byte[] diff); static byte[] undo(byte[] diff);  }### Answer:
@Test public void testDiff() throws Exception { String orig = "Hello world!"; String target = "Hellish cruel world!"; byte[] diff = ByteArrayDiffs.diff(orig.getBytes(), target.getBytes()); System.out.println("diff:" + diff.length); byte[] udiff = ByteArrayDiffs.udiff(orig.getBytes(), target.getBytes()); System.out.println("udiff:" + udiff.length); }
@Test public void testDiff_issue_2() throws Exception { byte[] prior = new byte[2270]; byte[] current = new byte[2281]; ByteArrayDiffs.diff(prior, current); }
@Test public void testZeroLengthOriginal() { ByteArrayDiffs.diff(new byte[0], new byte[1]); }
@Test public void testZeroLengthTarget() { ByteArrayDiffs.diff(new byte[1], new byte[0]); }