### Question:
TppNotificationDataValidator implements BusinessValidator<TppNotificationData> { @Override public @NotNull Set<TppMessageInformation> buildWarningMessages(@NotNull TppNotificationData tppNotificationData) { if (CollectionUtils.isNotEmpty(tppNotificationData.getNotificationModes()) && StringUtils.isNotBlank(tppNotificationData.getTppNotificationUri())) { return tppDomainValidator.buildWarningMessages(tppNotificationData.getTppNotificationUri()); } return Collections.emptySet(); }  @Override @NotNull ValidationResult validate(@NotNull TppNotificationData tppNotificationData); @Override @NotNull Set<TppMessageInformation> buildWarningMessages(@NotNull TppNotificationData tppNotificationData);  }### Answer:
@Test void buildWarningMessages_emptySet() { Set<TppMessageInformation> emptySet = new HashSet<>(); when(tppDomainValidator.buildWarningMessages(any())) .thenReturn(emptySet); Set<TppMessageInformation> actual = validator.buildWarningMessages(tppNotificationData); assertEquals(actual, emptySet); verify(tppDomainValidator, times(1)).buildWarningMessages(any()); }
@Test void buildWarningMessages_noCheck() { Set<TppMessageInformation> emptySet = new HashSet<>(); Set<TppMessageInformation> actual = validator.buildWarningMessages(emptyTppNotificationData); assertEquals(actual, emptySet); verify(tppDomainValidator, times(0)).buildWarningMessages(any()); }