Skip to content

Commit f1248f8

Browse files
johnmayegonw
authored andcommitted
Here we do the old-school iteration, we canot call stream().count() because it use the forEachRemaining method which will was not mocked.
1 parent 02b9d6b commit f1248f8

File tree

1 file changed

+6
-1
lines changed
  • base/isomorphism/src/main/java/org/openscience/cdk/isomorphism

1 file changed

+6
-1
lines changed

base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/Mappings.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,12 @@ public int[] first() {
534534
* @return number of matches
535535
*/
536536
public int count() {
537-
return Iterables.size(iterable);
537+
// Note: doesn't work when mocked due to forEachRemaining
538+
// return (int)stream().count();
539+
int count = 0;
540+
for (int[] m : iterable)
541+
count++;
542+
return count;
538543
}
539544

540545
/**

0 commit comments

Comments
 (0)