/** * test for copyFrom w/ null. */ @Test public void copyNull() { FloatOption option = new FloatOption(); option.modify(100); FloatOption other = new FloatOption(); 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() { FloatOption option = new FloatOption(); FloatOption other = new FloatOption(); other.modify(50); option.copyFrom(other); assertThat(option.get(), is(50.f)); option.modify(0); assertThat(other.get(), is(50.f)); }