@Test public void testClone() { assertEquals(gen11, gen11.clone()); assertEquals(gen11, gen11.clone()); assertEquals(rev99, rev99.clone()); assertEquals(rev99, rev99.clone()); }
@Test public void testAddSubtract() { assertEquals(v11n.distance(gen11, gen12), 1); assertEquals(v11n.distance(gen11, gen11), 0); assertEquals(v11n.distance(gen12, gen11), -1); Verse last = gen11.clone(); for (int i = 0; i < v11n.maximumOrdinal(); i += 99) { Verse next = v11n.add(last, i); assertEquals(v11n.distance(last, next), i); Verse next2 = v11n.subtract(next, i); assertEquals(gen11.getOsisID(), gen11, next2); } assertEquals(gen11.getOsisID(), gen11, v11n.subtract(gen11, 0)); assertEquals(gen11.getOsisID(), gen10, v11n.subtract(gen11, 1)); assertEquals(gen11.getOsisID(), gen00, v11n.subtract(gen11, 2)); assertEquals(gen11.getOsisID(), gen11, v11n.add(gen11, 0)); assertEquals(rev99.getOsisID(), rev99, v11n.add(rev99, 0)); assertEquals(rev99.getOsisID(), rev99, v11n.add(rev99, 1)); assertEquals(rev99.getOsisID(), rev99, v11n.add(rev99, 2)); }