public void testGetLength()
{
assertEquals(0, MappingUtils.getLength(null));
+
+ /*
+ * [start, end] ranges
+ */
List<int[]> ranges = new ArrayList<int[]>();
assertEquals(0, MappingUtils.getLength(ranges));
ranges.add(new int[] { 1, 1 });
assertEquals(10, MappingUtils.getLength(ranges));
ranges.add(new int[] { 20, 10 });
assertEquals(21, MappingUtils.getLength(ranges));
+
+ /*
+ * [start, end, start, end...] ranges
+ */
+ ranges.clear();
+ ranges.add(new int[] { 1, 5, 8, 4 });
+ ranges.add(new int[] { 8, 2 });
+ ranges.add(new int[] { 12, 12 });
+ assertEquals(18, MappingUtils.getLength(ranges));
}
@Test(groups = { "Functional" })