File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
main/java/org/javimmutable/collections/btree_list
test/java/org/javimmutable/collections/btree_list Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 4444import org .javimmutable .collections .SplitableIterator ;
4545import org .javimmutable .collections .common .ListAdaptor ;
4646import org .javimmutable .collections .common .StreamConstants ;
47- import org .javimmutable .collections .cursors .Cursors ;
4847import org .javimmutable .collections .indexed .IndexedList ;
48+ import org .javimmutable .collections .iterators .IteratorHelper ;
4949import org .javimmutable .collections .serialization .JImmutableRandomAccessListProxy ;
5050
5151import javax .annotation .Nonnull ;
@@ -457,19 +457,19 @@ public void checkInvariants()
457457 @ Override
458458 public boolean equals (Object o )
459459 {
460- return (o == this ) || ((o instanceof JImmutableList ) && Cursors . areEqual ( cursor (), ((JImmutableList )o ).cursor ()));
460+ return (o == this ) || ((o instanceof JImmutableList ) && IteratorHelper . iteratorEquals ( iterator (), ((JImmutableList )o ).iterator ()));
461461 }
462462
463463 @ Override
464464 public int hashCode ()
465465 {
466- return Cursors . computeHashCode ( cursor ());
466+ return IteratorHelper . iteratorHashCode ( iterator ());
467467 }
468468
469469 @ Override
470470 public String toString ()
471471 {
472- return Cursors . makeString ( cursor ());
472+ return IteratorHelper . iteratorToString ( iterator ());
473473 }
474474
475475 private Object writeReplace ()
Original file line number Diff line number Diff line change @@ -91,6 +91,8 @@ public void test()
9191 list .checkInvariants ();
9292 StandardCursorTest .indexedCursorTest (list , list .size (), list .cursor ());
9393 StandardCursorTest .indexedIteratorTest (list , list .size (), list .iterator ());
94+ assertEquals ("[100,200]" , list .toString ());
95+ assertEquals (3300 , list .hashCode ());
9496
9597 JImmutableBtreeList <Integer > saved = list ;
9698
You can’t perform that action at this time.
0 commit comments