### Question:
PaymentTypeAndProductValidator { public @NotNull ValidationResult validateTypeAndProduct(@NotNull PaymentType paymentType, String paymentProduct) { Map<PaymentType, Set<String>> supportedPaymentTypeAndProductMatrix = aspspProfileServiceWrapper.getSupportedPaymentTypeAndProductMatrix(); if (supportedPaymentTypeAndProductMatrix.containsKey(paymentType)) { if (supportedPaymentTypeAndProductMatrix.get(paymentType).contains(paymentProduct)) { return ValidationResult.valid(); } return ValidationResult.invalid(ErrorType.PIS_404, TppMessageInformation.of(PRODUCT_UNKNOWN_WRONG_PAYMENT_PRODUCT, paymentProduct)); } return ValidationResult.invalid(ErrorType.PIS_400, TppMessageInformation.of(PARAMETER_NOT_SUPPORTED_WRONG_PAYMENT_TYPE, paymentType.getValue())); }  @NotNull ValidationResult validateTypeAndProduct(@NotNull PaymentType paymentType, String paymentProduct);  }### Answer:
@Test void validatePaymentInitiationParams_correct() { ValidationResult actual = paymentProductAndTypeValidator.validateTypeAndProduct(PaymentType.SINGLE, CORRECT_PAYMENT_PRODUCT); assertTrue(actual.isValid()); }
@Test void validatePaymentInitiationParams_wrongProduct() { ValidationResult actual = paymentProductAndTypeValidator.validateTypeAndProduct(PaymentType.SINGLE, WRONG_PAYMENT_PRODUCT); assertTrue(actual.isNotValid()); assertEquals(1, actual.getMessageError().getTppMessages().size()); assertEquals(MessageErrorCode.PRODUCT_UNKNOWN_WRONG_PAYMENT_PRODUCT, actual.getMessageError().getTppMessage().getMessageErrorCode()); }
@Test void validatePaymentInitiationParams_unsupportedType() { ValidationResult actual = paymentProductAndTypeValidator.validateTypeAndProduct(UNSUPPORTED_PAYMENT_TYPE, CORRECT_PAYMENT_PRODUCT); assertTrue(actual.isNotValid()); assertEquals(1, actual.getMessageError().getTppMessages().size()); assertEquals(PARAMETER_NOT_SUPPORTED_WRONG_PAYMENT_TYPE, actual.getMessageError().getTppMessage().getMessageErrorCode()); }