@Test
public void testFind() {
em.clear();
Collection<RecordingEntity> recordings = recordingRepository.findAll();
assert recordings.size() == 4;
Recording recording = recordings.iterator().next();
assert !((PersistentCollection) recording.getContributors()).wasInitialized();
assert recording.getWorks().iterator().next().getName().equals("I Will Always Love You");
assert recording.getContributors().size() == 2;
em.clear();
recordings = recordingRepository.findAllWithRelations(Arrays.asList("works"), Arrays.asList("contributors"));
assert recordings.size() == 4;
recording = recordings.iterator().next();
assert ((PersistentCollection) recording.getContributors()).wasInitialized();
assert recording.getContributors().size() > 0;
em.clear();
recording = recordingRepository.findById(recordings.iterator().next().getId());
assert recording != null;
}