Dex a = resourceToDexBuffer("/testdata/A.dex");
Dex b = resourceToDexBuffer("/testdata/B.dex");
// a and b don't overlap; this should succeed
Dex ab = new DexMerger(a, b, CollisionPolicy.FAIL).merge();
// a and ab overlap; this should fail
DexMerger dexMerger = new DexMerger(a, ab, CollisionPolicy.FAIL);
try {
dexMerger.merge();
fail();
} catch (DexException expected) {
assertEquals("Multiple dex files define Ltestdata/A;", expected.getMessage());
}