class Roles {

    public static String getInterpolatedRoleName(String rawName, String... oids) {
        StringBuffer interpolatedRoleName = new StringBuffer();
        Matcher matcher = ROLE_OID_REGEX.matcher(rawName);

        int i=0;
        while(matcher.find()){
            matcher.appendReplacement(interpolatedRoleName, oids[i]);
            i++;
        }
        matcher.appendTail(interpolatedRoleName);
        return interpolatedRoleName.toString();
    }

}