public static InvalidContractStatusException contractNotYetApprovedException(List<ContractSummaryBean> contracts) {
        return new InvalidContractStatusException(Messages.i18n.format("ContractNotYetApproved",
             contracts.stream()
                      .filter(c -> c.getStatus() == ContractStatus.AwaitingApproval)
                      .map(ContractSummaryBean::getContractId)
                      .collect(Collectors.toList())));
    }
Creates an exception from an contract id.
@param contractId the contract id
@return the exception
manager/api/exceptions/src/main/java/io/apiman/manager/api/rest/exceptions/util/ExceptionFactory.java