Get certification rules from collection
There's a lot of waste in this method.  You're copying things to idList, only to clear them.  You're creating idList, only to copy it to result.

Try this:

public static Collection&lt;AccessRuleTemplate&gt; getCaRules(String roleName, Collection&lt;Integer&gt; currentcas) {
    List&lt;AccessRuleTemplate&gt; carules = new ArrayList&lt;&gt;();
    if (currentcas.contains(Integer.valueOf(BasicAccessRuleSet.CA_ALL))) {
        carules.add(new AccessRuleTemplate(StandardRules.CAACCESSBASE.resource(), AccessRuleState.RULE_ACCEPT, true));
    } else {
        for (Integer caId : currentcas) {
            carules.add(new AccessRuleTemplate(StandardRules.CAACCESS.resource() + caId.toString(), AccessRuleState.RULE_ACCEPT, false));
        }
    }
    return carules;
}


So, in the case where the item is found, there's a big savings - you don't create a bunch of objects and discard them.
In the case where the item is not found, there's a very slight increase in time to traverse the list twice.
In both cases, the copying between lists is eliminated, making this much more efficient (and readable).

I'd also recommend that for the "found" case, you pre-create a static, immutable, singleton list which you can directly return each time.

private static final Collection&lt;AccessRuleTemplate&gt; BASE_ACCESS_TEMPLATE
        = Collections.singletonList(new AccessRuleTemplate(StandardRules.CAACCESSBASE.resource(), AccessRuleState.RULE_ACCEPT, true));


Also "roleName" is unused.  I'm guessing it was only used in logging which was stripped out.

Finally, though you could use a lambda function for the conversion loop, I think the code above is simpler.  If you really want to, it would look something like:

return currentcas.stream()
        .map(caId -&gt; {new AccessRuleTemplate(StandardRules.CAACCESS.resource() + caId.toString(), AccessRuleState.RULE_ACCEPT, false)})
        .collect(Collectors.toList());