+ /**
+ * Testing isEmpty() method
+ */
+ @Test
+ public void testIsEmpty() {
+ assertFalse(fSegmentStore.isEmpty());
+ fSegmentStore.clear();
+ assertTrue(fSegmentStore.isEmpty());
+ }
+
+ /**
+ * Testing adding a collection with the addAll method
+ */
+ @Test
+ public void testAddAll() {
+ assertFalse(fSegmentStore.isEmpty());
+ fSegmentStore.clear();
+ assertTrue(fSegmentStore.isEmpty());
+ fSegmentStore.addAll(SEGMENTS);
+ assertTrue(fSegmentStore.containsAll(SEGMENTS));
+ }
+
+ /**
+ * Testing "copy" constructor
+ */
+ @Test
+ public void testAddAllConstructor() {
+ @SuppressWarnings("null")
+ ISegmentStore<@NonNull ISegment> other = getSegmentStore(fSegmentStore.toArray(new ISegment[fSegmentStore.size()]));
+ assertTrue(fSegmentStore.containsAll(other));
+ assertTrue(other.containsAll(fSegmentStore));
+ }
+
+ /**
+ * Testing "copy" constructor out of order
+ */
+ @Test
+ public void testAddAllConstructorOutOfOrder() {
+ @SuppressWarnings("null")
+ ISegmentStore<@NonNull ISegment> other = getSegmentStore(REVERSE_SEGMENTS.toArray(new ISegment[fSegmentStore.size()]));
+ assertTrue(fSegmentStore.containsAll(other));
+ assertTrue(other.containsAll(fSegmentStore));
+ }
+
+ /**
+ * Testing adding an out of order collection with the addAll method
+ */
+ @Test
+ public void testAddAllOutOfOrder() {
+ assertFalse(fSegmentStore.isEmpty());
+ fSegmentStore.clear();
+ assertTrue(fSegmentStore.isEmpty());
+ fSegmentStore.addAll(REVERSE_SEGMENTS);
+ assertTrue(fSegmentStore.containsAll(SEGMENTS));
+ }
+