void () { final ScaleContext origContext = ScaleContext.create(); Consumer<ScaleType> test = type -> { double overriddenScale = origContext.getScale(type) + 1; origContext.overrideScale(type.of(overriddenScale)); // Test (A) 'setScale' origContext.setScale(type.of(overriddenScale + 1)); assertThat(origContext.getScale(type)). describedAs("overridden scale is not preserved on 'ScaleContext.setScale': " + type). isEqualTo(overriddenScale); // Test (B) 'copy' ScaleContext contextCopy = origContext.copy(); assertThat(contextCopy).isNotSameAs(origContext); assertContext(origContext, contextCopy); contextCopy.setScale(type.of(overriddenScale + 1)); assertThat(contextCopy.getScale(type)). describedAs("overridden scale is not preserved on 'ScaleContext.copy': " + type). isEqualTo(overriddenScale); }; test.accept(USR_SCALE); test.accept(SYS_SCALE); test.accept(OBJ_SCALE); }