final YearMonthDay startDate, final YearMonthDay endDate, final Money minAmount, final Money maxAmount) {
IndividualCandidacyPaymentCode paymentCode = getAvailablePaymentCodeForReuse();
paymentCode.reuse(startDate, endDate, minAmount, maxAmount, null);
return paymentCode;
}
<BUG>protected static IndividualCandidacyPaymentCode getAvailablePaymentCodeForReuse() {
Set<IndividualCandidacyPaymentCode> individualCandidacyPaymentCodes =
Sets.newHashSet(Iterables.filter(Bennu.getInstance().getPaymentCodesSet(), IndividualCandidacyPaymentCode.class));
for (IndividualCandidacyPaymentCode paymentCode : individualCandidacyPaymentCodes) {
if (paymentCode.isAvailableForReuse()) {
return paymentCode;
}
}
return null;</BUG>
}

final YearMonthDay startDate, final YearMonthDay endDate, final Money minAmount, final Money maxAmount) {
IndividualCandidacyPaymentCode paymentCode = getAvailablePaymentCodeForReuse();
paymentCode.reuse(startDate, endDate, minAmount, maxAmount, null);
return paymentCode;
}
protected static IndividualCandidacyPaymentCode getAvailablePaymentCodeForReuse() {
return (IndividualCandidacyPaymentCode) Bennu.getInstance().getPaymentCodesSet().stream()
.filter((IndividualCandidacyPaymentCode.class)::isInstance).filter(PaymentCode::isAvailableForReuse).findFirst()
.orElse(null);
}
