### Question:
LevelsOfAssuranceConfigValidator { protected void validateAllTransactionsAreLOA1OrLOA2(Set<TransactionConfig> transactionConfig) { List<TransactionConfig> badTransactionConfigs = transactionConfig.stream() .filter(x -> { List<LevelOfAssurance> levelsOfAssurance = x.getLevelsOfAssurance(); boolean isLoa1 = levelsOfAssurance.equals(asList(LEVEL_1, LEVEL_2)); boolean isLoa2And1 = levelsOfAssurance.equals(asList(LEVEL_2, LEVEL_1)); boolean isLoa2 = levelsOfAssurance.equals(singletonList(LEVEL_2)); return !(isLoa1 || isLoa2 || isLoa2And1); }) .collect(Collectors.toList()); if(!badTransactionConfigs.isEmpty()) { throw ConfigValidationException.createTransactionsRequireUnsupportedLevelOfAssurance(badTransactionConfigs); } }  void validateLevelsOfAssurance(final Set<IdentityProviderConfig> identityProviderConfig,
                                           final Set<TransactionConfig> transactionConfig);  }### Answer:
@Test public void shouldAllowLOA1TransactionConfiguration() { Set<TransactionConfig> transactionsConfig = Set.of(loa1And2Transaction); try { levelsOfAssuranceConfigValidator.validateAllTransactionsAreLOA1OrLOA2(transactionsConfig); } catch (Exception e) { fail("Expected exception not thrown"); } }
@Test public void shouldAllowLOA2AndLOA1TransactionConfiguration() { Set<TransactionConfig> transactionsConfig = Set.of(loa2And1Transaction); try { levelsOfAssuranceConfigValidator.validateAllTransactionsAreLOA1OrLOA2(transactionsConfig); } catch (Exception e) { fail("Expected exception not thrown"); } }
@Test public void shouldAllowLOA2TransactionConfiguration() { Set<TransactionConfig> transactionsConfig = Set.of(loa2Transaction); try { levelsOfAssuranceConfigValidator.validateAllTransactionsAreLOA1OrLOA2(transactionsConfig); } catch (Exception e) { fail("Expected exception not thrown"); } }
@Test(expected = ConfigValidationException.class) public void shouldThrowWhenTransactionIsLoa1Only() { levelsOfAssuranceConfigValidator.validateAllTransactionsAreLOA1OrLOA2(Set.of(loa1OnlyTransaction)); }
@Test(expected = ConfigValidationException.class) public void shouldThrowWhenTransactionIsNotLoa1OrLoa2() { levelsOfAssuranceConfigValidator.validateAllTransactionsAreLOA1OrLOA2(Set.of(loa3OnlyTransaction)); }