Object first = it.next();
Object second = it.next();
Object toKey = it.next();
int size = sm.size();
SortedMap sub = sm.subMap(fromKey, toKey);
Set set = sub.entrySet();
assertEquals(3, set.size());
Iterator it2 = set.iterator();
Object fromEntry = it2.next();
Map.Entry firstEntry = cloneMapEntry((Map.Entry) it2.next());
Map.Entry secondEntry = cloneMapEntry((Map.Entry) it2.next());
assertEquals(true, sm.containsKey(first));
assertEquals(true, sub.containsKey(first));
assertEquals(true, set.contains(firstEntry));
assertEquals(true, sm.containsKey(second));
assertEquals(true, sub.containsKey(second));
assertEquals(true, set.contains(secondEntry));
set.remove(firstEntry);
assertEquals(2, sub.size());
assertEquals(size - 1, sm.size());
assertEquals(size - 1, sm.inverseBidiMap().size());
assertEquals(false, sm.containsKey(firstEntry.getKey()));
assertEquals(false, sm.containsValue(firstEntry.getValue()));
assertEquals(false, sm.inverseBidiMap().containsKey(firstEntry.getValue()));
assertEquals(false, sm.inverseBidiMap().containsValue(firstEntry.getKey()));
assertEquals(false, sub.containsKey(firstEntry.getKey()));
assertEquals(false, sub.containsValue(firstEntry.getValue()));
assertEquals(false, set.contains(firstEntry));
set.remove(secondEntry);
assertEquals(1, sub.size());
assertEquals(size - 2, sm.size());
assertEquals(size - 2, sm.inverseBidiMap().size());
assertEquals(false, sm.containsKey(secondEntry.getKey()));
assertEquals(false, sm.containsValue(secondEntry.getValue()));
assertEquals(false, sm.inverseBidiMap().containsKey(secondEntry.getValue()));
assertEquals(false, sm.inverseBidiMap().containsValue(secondEntry.getKey()));
assertEquals(false, sub.containsKey(secondEntry.getKey()));
assertEquals(false, sub.containsValue(secondEntry.getValue()));
assertEquals(false, set.contains(secondEntry));
}