I have some groovy code that uses streams,
List<MolportEntryVerification> verificationList = molportEntries.stream()
.peek{if(i++%50 == 0){println(df.format(i/count))}}
.map({entry -> verifier.verifyEntry(entry, new Standardizer(molportConfig), new Standardizer(bciConfig))})
.collect(Collectors.toList())
Give rise to:
Caught: groovy.lang.MissingMethodException: No signature of method: java.util.stream.ReferencePipeline$Head.peek() is applicable for argument types: (MolportFileVerification$_run_closure1) values: [MolportFileVerification$_run_closure1@d62472f] Possible solutions: peek(java.util.function.Consumer), grep(), sleep(long), use([Ljava.lang.Object;), grep(java.lang.Object), wait()
long count = molportEntries.stream().count();
works with no error message.
molportEntries is a list of BasicMolportEntry, which is a simple java class
public class BasicMolportEntry {
public BasicMolportEntry(String molportId, String etxcId, String smiles) {
this.molportId = molportId == null ? "" : molportId;
this.etxcId = etxcId == null ? "" : etxcId;
this.smiles = smiles;
}
plus all the usual...
Any suggestions?