Remove the object cache
[yangtools.git] / third-party / triemap / src / test / java / org / opendaylight / yangtools / triemap / TestReadOnlyAndUpdatableIterators.java
index 15a658e21e628e07560b66b41951b0adf2b605b6..4ac015a829ddb4be8282da353b9c4eb8dbee9f86 100644 (file)
@@ -23,11 +23,9 @@ import java.util.Map.Entry;
 import org.junit.Before;
 import org.junit.Test;
 
-/***
- *
+/**
  * Test that read-only iterators do not allow for any updates.
  * Test that non read-only iterators allow for updates.
- *
  */
 public class TestReadOnlyAndUpdatableIterators {
     private static final int MAP_SIZE = 200;
@@ -53,22 +51,22 @@ public class TestReadOnlyAndUpdatableIterators {
 
     @Test(expected = UnsupportedOperationException.class)
     public void testReadOnlyIteratorSet() {
-        trySet(bt.readOnlyIterator());
+        trySet(bt.immutableIterator());
     }
 
     @Test(expected = UnsupportedOperationException.class)
     public void testReadOnlyIteratorRemove() {
-        tryRemove(bt.readOnlyIterator());
+        tryRemove(bt.immutableIterator());
     }
 
     @Test(expected = UnsupportedOperationException.class)
     public void testReadOnlySnapshotReadOnlyIteratorSet() {
-        trySet(bt.immutableSnapshot().readOnlyIterator());
+        trySet(bt.immutableSnapshot().immutableIterator());
     }
 
     @Test(expected = UnsupportedOperationException.class)
     public void testReadOnlySnapshotReadOnlyIteratorRemove() {
-        tryRemove(bt.immutableSnapshot().readOnlyIterator());
+        tryRemove(bt.immutableSnapshot().immutableIterator());
     }
 
     @Test(expected = UnsupportedOperationException.class)
@@ -82,9 +80,9 @@ public class TestReadOnlyAndUpdatableIterators {
     }
 
     @Test
-    public void testIterator () {
+    public void testIterator() {
         Iterator<Entry<Integer, Integer>> it = bt.iterator();
-        it.next().setValue (0);
+        it.next().setValue(0);
         it.remove();
 
         // All changes are done on the original map
@@ -92,7 +90,7 @@ public class TestReadOnlyAndUpdatableIterators {
     }
 
     @Test
-    public void testSnapshotIterator () {
+    public void testSnapshotIterator() {
         TrieMap<Integer, Integer> snapshot = bt.mutableSnapshot();
         Iterator<Entry<Integer, Integer>> it = snapshot.iterator();
         it.next().setValue(0);
@@ -100,8 +98,8 @@ public class TestReadOnlyAndUpdatableIterators {
 
         // All changes are done on the snapshot, not on the original map
         // Map size should remain unchanged
-        assertEquals(MAP_SIZE, bt.size ());
+        assertEquals(MAP_SIZE, bt.size());
         // snapshot size was changed
-        assertEquals(MAP_SIZE-1, snapshot.size ());
+        assertEquals(MAP_SIZE - 1, snapshot.size());
     }
 }