File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
main/java/org/javimmutable/collections/list
test/java/org/javimmutable/collections/list Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 3939import org .javimmutable .collections .JImmutableStack ;
4040import org .javimmutable .collections .SplitableIterator ;
4141import org .javimmutable .collections .common .StreamConstants ;
42- import org .javimmutable .collections .cursors .Cursors ;
4342import org .javimmutable .collections .cursors .SequenceCursor ;
43+ import org .javimmutable .collections .iterators .IteratorHelper ;
4444import org .javimmutable .collections .iterators .SequenceIterator ;
4545import org .javimmutable .collections .serialization .JImmutableStackProxy ;
4646
@@ -165,19 +165,19 @@ public List<V> makeList()
165165 @ Override
166166 public boolean equals (Object o )
167167 {
168- return (o instanceof JImmutableStack ) && Cursors . areEqual ( cursor (), ((JImmutableStack )o ).cursor ());
168+ return (o instanceof JImmutableStack ) && IteratorHelper . iteratorEquals ( iterator (), ((JImmutableStack )o ).iterator ());
169169 }
170170
171171 @ Override
172172 public int hashCode ()
173173 {
174- return Cursors . computeHashCode ( cursor ());
174+ return IteratorHelper . iteratorHashCode ( iterator ());
175175 }
176176
177177 @ Override
178178 public String toString ()
179179 {
180- return Cursors . makeString ( cursor ());
180+ return IteratorHelper . iteratorToString ( iterator ());
181181 }
182182
183183 @ Nonnull
Original file line number Diff line number Diff line change @@ -85,6 +85,8 @@ public void test()
8585 assertEquals (Collections .<Integer >emptyList (), list .makeList ());
8686 assertEquals (Arrays .asList (10 ), list2 .makeList ());
8787 assertEquals (Arrays .asList (30 , 10 ), list3 .makeList ());
88+ assertEquals ("[30,10]" , list3 .toString ());
89+ assertEquals (940 , list3 .hashCode ());
8890
8991 assertEquals (list , JImmutableLinkedStack .of (Collections .<Integer >emptyList ()));
9092 assertEquals (list2 , JImmutableLinkedStack .of (Arrays .asList (10 )));
You can’t perform that action at this time.
0 commit comments