@Test
public void load() throws Exception {

    LimitViolationFilter filter = LimitViolationFilter.load(platformConfig);
    assertEquals(EnumSet.of(LimitViolationType.CURRENT, LimitViolationType.LOW_VOLTAGE), filter.getViolationTypes());
    assertEquals(150.0, filter.getMinBaseVoltage(), 0.0);
    assertEquals(EnumSet.of(Country.FR, Country.BE), filter.getCountries());
    filter.setViolationTypes(EnumSet.of(LimitViolationType.HIGH_VOLTAGE));
    assertEquals(EnumSet.of(LimitViolationType.HIGH_VOLTAGE), filter.getViolationTypes());
    filter.setMinBaseVoltage(225.0);
    filter.setCountries(EnumSet.of(Country.FR));
    assertEquals(EnumSet.of(Country.FR), filter.getCountries());
    assertEquals(225.0, filter.getMinBaseVoltage(), 0.0);
    filter.setViolationTypes(null);
    assertEquals(LimitViolationType.values().length, filter.getViolationTypes().size());
    filter.setCountries(null);
    assertEquals(Country.values().length, filter.getCountries().size());
    try {
        filter.setViolationTypes(EnumSet.noneOf(LimitViolationType.class));
        fail();
    } catch (Exception ignored) {
    }
    try {
        filter.setMinBaseVoltage(-3.0);
        fail();
    } catch (Exception ignored) {
    }
}