I would like to add a postfix called "-Inbox" to each of the elements of a collection of strings. Here is my current approach:
<span>def</span> <span>matchedVersions</span> <span>=</span> issue.getFixVersions().intersect(
newIssueproject.getVersions(),
Version.NAME_COMPARATOR
)
<span>def</span> <span>mynewVersions</span> <span>=</span> <span>new</span> <span>ArrayList</span> <Version> ()
<span>for</span>( Version v: matchedVersions){
Version mynewVersion= ComponentAccessor.versionManager.createVersion(v.getName()+<span>"-Inbox"</span>, startDate, releaseDate, description, newIssueproject.id, scheduleAfterVersion, released)
mynewVersions.add(mynewVersion)
}Is there a simpler approach that I could use to avoid the loop, the action I am doing is repetitive and takes time and I would like to find a new approach. I just need to create a new varaible called mynewVersions which is identical to matchedVersions with the only difference being that the name of each version has the postfix "-Inbox" appended.