/** * Gets a new instance of a Configuration for this builder. * * @param constructor A Supplier for a ConfigBuilder for the given Configuration. * @param <T> The type of the Configuration to instantiate. */ public <T> T getConfig(Supplier<? extends ConfigBuilder<? extends T>> constructor) { return constructor.get() .rebase(this.properties) .build(); }
val builder2 = builder1.rebase(p2); Assert.assertNotEquals("rebase() returned the same instance.", builder1, builder2); Assert.assertEquals("rebase() touched the target Properties object.", 1, p2.size());