@@ -135,22 +135,23 @@ protected void assertXPathValueAndPointer(final JXPathContext ctx,
135135 assertXPathPointer (ctx , xpath , expectedPointer );
136136 }
137137
138- protected void assertXPathValueIterator (final JXPathContext ctx ,
139- final String xpath , final Collection expected )
138+ protected < E > void assertXPathValueIterator (final JXPathContext ctx ,
139+ final String xpath , final Collection < E > expected )
140140 {
141- Collection actual ;
141+ Collection < E > actual ;
142142 if (expected instanceof List ) {
143- actual = new ArrayList ();
144- }
145- else {
146- actual = new HashSet ();
143+ actual = new ArrayList <>();
144+ } else {
145+ actual = new HashSet <>();
147146 }
148- final Iterator it = ctx .iterate (xpath );
147+ final Iterator < E > it = ctx .iterate (xpath );
149148 while (it .hasNext ()) {
150149 actual .add (it .next ());
151150 }
152- assertEquals ("Evaluating value iterator <" + xpath + ">" ,
153- expected , actual );
151+ assertEquals (String .format ("[hashCode()] Evaluating value iterator <%s>, expected.class %s(%,d): %s, actual.class %s(%,d): %s" , xpath ,
152+ expected .getClass (), expected .size (), expected , actual .getClass (), actual .size (), actual ), expected .hashCode (), actual .hashCode ());
153+ assertEquals (String .format ("[equals()] Evaluating value iterator <%s>, expected.class %s(%,d): %s, actual.class %s(%,d): %s" , xpath ,
154+ expected .getClass (), expected .size (), expected , actual .getClass (), actual .size (), actual ), expected , actual );
154155 }
155156
156157 protected void assertXPathPointerIterator (
0 commit comments