@Test public void shouldNotBeEqualToAnotherPositionIfTheirCodesAreNotEqual() { JobPosition other = new JobPosition(position.getCode() + "X"); assertThat(position, is(not(equalTo(other)))); }
@Test public void equalsAnotherPositionWithTheSameCode() { JobPosition other = new JobPosition(position.getCode()); assertThat(position, is(equalTo(other))); assertThat(position.hashCode(), is(other.hashCode())); }