for (Issue issue : issues) {
if (issue.getSubtasks().spliterator().estimateSize() > 0) {
alreadyCreated = false;
for (Subtask subtask : issue.getSubtasks()) {
if (subtask.getSummary().contains("sometext")) {
alreadyCreated = true;
break;
}
}
if (!alreadyCreated) {
ids.add(issue.getKey());
}
} else {
ids.add(issue.getKey());
}
}
I'm not so expert with Java stream API, but I'm pretty sure there's some way to simplify the code above with using lambda expressions. Would be a great help to understand it even better!
Some notes: Issues and getSubtasks() are returning back Iterable<> types.