Skip to content

Instantly share code, notes, and snippets.

@cosbor11
Last active March 29, 2016 04:52
Show Gist options
  • Select an option

  • Save cosbor11/ade2259ecb18a944e3c8 to your computer and use it in GitHub Desktop.

Select an option

Save cosbor11/ade2259ecb18a944e3c8 to your computer and use it in GitHub Desktop.
The episodes should not be null and they are lazily loaded
// Assert the episodes are lazily loaded
firstSeason = theSopranosCopy.seasons.get(0);
assertNotNull("The first seasons' episodes should not be null since it is lazily loaded", firstSeason.episodes);
assertTrue("The first seasons' episodes should be LazyRelationshipCollection", (firstSeason.episodes instanceof LazyRelationshipCollection));
// Notice when I reference an episode it is hydrated
Episode episode = firstSeason.episodes.get(0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment