Skip to content

Instantly share code, notes, and snippets.

@kikers25
Created January 8, 2017 19:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kikers25/d082ae9829e20113a0b9c704b102d3dc to your computer and use it in GitHub Desktop.
Save kikers25/d082ae9829e20113a0b9c704b102d3dc to your computer and use it in GitHub Desktop.
Unit tests with dates 2
public void mutability() throws Exception {
User user = new User().setDateOfBirth(new Date(1990, 1, 1));
Date date = user.getDateOfBirth();
date.setYear(2014);
assertThat(user.getDateOfBirth(), is(new Date(2014, 1, 1)));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment