private Role getRole(Package apiPackage, String sigenrId) {
   for (Role role : apiPackage.getRoles()) {
     for (Signer signer : role.getSigners()) {
       if (signer.getId().equals(sigenrId)) {
         return role;
       }
     }
   }
   return new Role();
 }
  private Role findRoleForGroup(PackageId packageId, String groupId) {
    List<Role> roles = getRoles(packageId);

    for (Role role : roles) {
      if (!role.getSigners().isEmpty()) {
        Signer signer = role.getSigners().get(0);
        if (signer.getGroup() != null) {
          if (signer.getGroup().getId().equals(groupId)) {
            return role;
          }
        }
      }
    }
    return null;
  }