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