Horse horse = new Horse();
horse.setName("Palefrenier");
em.persist(horse);
Cavalier cavalier = new Cavalier();
cavalier.setName("Caroline");
cavalier.setHorse(horse);
em.persist(cavalier);
em.flush();
em.clear();
cavalier = em.find(Cavalier.class, cavalier.getId());
assertThat(cavalier).isNotNull();
horse = cavalier.getHorse();
assertThat(horse).isNotNull();
em.remove(cavalier);
em.remove(horse);
em.flush();