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