if (canCloseEvent(whenRegistered)) {
if (canCloseEvent(whenRegistered) && hasNonProcessedPaymentCode()) {
    public void changePaymentCodeState(DateTime whenRegistered, PaymentMode paymentMode) {	if (canCloseEvent(whenRegistered)) {	    getNonProcessedPaymentCode().setState(getPaymentCodeStateFor(paymentMode));	}    }