### Question:
UnlimitedResizePolicy implements ResizePolicy { @PluginBuilderFactory public static Builder newBuilder() { return new Builder(); } private  UnlimitedResizePolicy(double resizeFactor); @Override boolean increase(ItemSourcePool itemSourcePool); @Override boolean decrease(ItemSourcePool itemSourcePool); @PluginBuilderFactory static Builder newBuilder(); static final String PLUGIN_NAME; }### Answer:
@Test public void builderBuildsSuccessfully() { UnlimitedResizePolicy.Builder builder = UnlimitedResizePolicy.newBuilder(); ResizePolicy policy = builder.build(); assertNotNull(policy); }
@Test public void builderThrowsWhenResizeFactorIsZero() { UnlimitedResizePolicy.Builder builder = UnlimitedResizePolicy.newBuilder(); builder.withResizeFactor(0); expectedException.expect(ConfigurationException.class); expectedException.expectMessage("must be higher than 0"); builder.build(); }
@Test public void builderThrowsWhenResizeFactorIsLowerThanZero() { UnlimitedResizePolicy.Builder builder = UnlimitedResizePolicy.newBuilder(); builder.withResizeFactor(-0.1); expectedException.expect(ConfigurationException.class); expectedException.expectMessage("must be higher than 0"); builder.build(); }
@Test public void builderThrowsWhenResizeFactorIsHigherThanOne() { UnlimitedResizePolicy.Builder builder = UnlimitedResizePolicy.newBuilder(); builder.withResizeFactor(1.01); expectedException.expect(ConfigurationException.class); expectedException.expectMessage("must be lower or equal 1"); builder.build(); }