### Question:
AbstractIntegerModifier implements VariableModifier<T> { @Override public void init(final ModifierProperties properties) { this.minimum = Optional.ofNullable(properties.getLong("minimum")).orElse(0L); this.maximum = Optional.ofNullable(properties.getLong("maximum")).orElse(UnsignedInteger.MAX_VALUE.longValue()); this.minimumStep = Optional.ofNullable(properties.getLong("minimumStep")).orElse(0L); this.maximumStep = Optional.ofNullable(properties.getLong("maximumStep")).orElse(1L); Preconditions.checkArgument(minimum >= 0, "minimum should not be negative"); Preconditions.checkArgument(maximum >= 0, "maximum should not be negative"); Preconditions.checkArgument(minimum <= UnsignedInteger.MAX_VALUE.longValue(), "minimum should not exceed 2^32-1 (4294967295 decimal)"); Preconditions.checkArgument(maximum <= UnsignedInteger.MAX_VALUE.longValue(), "maximum should not exceed 2^32-1 (4294967295 decimal)"); }  @Override void init(final ModifierProperties properties); @Override final T modify(final T variable);  }### Answer:
@Test(expectedExceptions = { IllegalArgumentException.class }) public void testIllegalInitParameterMinimum() { final ModifierProperties modifierProperties = new ModifierProperties(); modifierProperties.put("minimum", -1); modifierProperties.put("maximum", 3000); modifierProperties.put("minimumStep", 1); modifierProperties.put("maximumStep", 10); final Gauge32Modifier modifier = new Gauge32Modifier(); modifier.init(modifierProperties); }
@Test(expectedExceptions = { IllegalArgumentException.class }) public void testIllegalInitParameterMaximum() { final ModifierProperties modifierProperties = new ModifierProperties(); modifierProperties.put("minimum", 0); modifierProperties.put("maximum", -1); modifierProperties.put("minimumStep", 1); modifierProperties.put("maximumStep", 10); final Gauge32Modifier modifier = new Gauge32Modifier(); modifier.init(modifierProperties); }
@Test public void testProperties() { final ModifierProperties modifierProperties = new ModifierProperties(); modifierProperties.put("minimum", 0); modifierProperties.put("maximum", 10); modifierProperties.put("minimumStep", 1); modifierProperties.put("maximumStep", 10); final Gauge32Modifier modifier = new Gauge32Modifier(); modifier.init(modifierProperties); assertEquals(modifier.getMinimum(), 0); assertEquals(modifier.getMaximum(), 10); assertEquals(modifier.getMinimumStep(), 1); assertEquals(modifier.getMaximumStep(), 10); }