public static IdentityHashMap<AclLineMatchExpr, IpAccessListLineIndex> literalsToLines( Collection<IpAccessList> acls) { IdentityHashMap<AclLineMatchExpr, IpAccessListLineIndex> literalsToLines = new IdentityHashMap<>(); acls.forEach( currAcl -> { List<IpAccessListLine> lines = currAcl.getLines(); IntStream.range(0, lines.size()) .forEach( i -> AclLineMatchExprLiterals.getLiterals(lines.get(i).getMatchCondition()) .forEach( lit -> literalsToLines.put(lit, new IpAccessListLineIndex(currAcl, i)))); }); return literalsToLines; }