public static Application entity2domain(ApplicationEntity entity, List<String> expandList) {
    Application application = new Application();
    application.setId(entity.getId());
    application.setEncryptionCertificate(entity.getEncryptionCertificate());
    application.setLifeTime(entity.getLifeTime());
    application.setProtocol(entity.getProtocol());
    application.setRealm(entity.getRealm());
    application.setRole(entity.getRole());
    application.setServiceDescription(entity.getServiceDescription());
    application.setServiceDisplayName(entity.getServiceDisplayName());
    application.setTokenType(entity.getTokenType());
    application.setPolicyNamespace(entity.getPolicyNamespace());
    application.setPassiveRequestorEndpoint(entity.getPassiveRequestorEndpoint());

    if (expandList != null && (expandList.contains("all") || expandList.contains("claims"))) {
      for (ApplicationClaimEntity item : entity.getRequestedClaims()) {
        RequestClaim claim = entity2domain(item);
        application.getRequestedClaims().add(claim);
      }
    }
    return application;
  }