/** * test for copyFrom w/ null. */ @Test public void copyNull() { DoubleOption option = new DoubleOption(); option.modify(100); DoubleOption other = new DoubleOption(); option.copyFrom(other); assertThat(option.isNull(), is(true)); option.modify(100); option.copyFrom(null); assertThat(option.isNull(), is(true)); }
/** * test for copyFrom. */ @Test public void copy() { DoubleOption option = new DoubleOption(); DoubleOption other = new DoubleOption(); other.modify(50); option.copyFrom(other); assertThat(option.get(), is(50.d)); option.modify(0); assertThat(other.get(), is(50.d)); }