### Question:
ConnectedRealm extends PanacheEntityBase { public ConnectedRealm create() { realms.stream() .filter(realm -> realm.getConnectedRealm() == null) .forEach(realm -> realm.setConnectedRealm(this)); persist(); return this; } @Builder(toBuilder = true)  ConnectedRealm(
        final String id,
        final Region region,
        @Singular
        final Set<Realm> realms,
        final Map<FolderType, Folder> folders,
        final Set<AuctionFile> files); void addRealm(final Realm realm); ConnectedRealm create(); ConnectedRealm update(final ConnectedRealm connectedRealm);  }### Answer:
@Test @Transactional void create() { ConnectedRealm connectedRealm = ConnectedRealm.builder() .id(UUID.randomUUID().toString()) .region(Region.EU) .realm(Realm.builder() .id(UUID.randomUUID().toString()) .name("Hellscream") .slug("hellscream") .build()) .build(); ConnectedRealm createdConnectedRealm = connectedRealm.create(); assertEquals(connectedRealm.getId(), createdConnectedRealm.getId()); assertFalse(createdConnectedRealm.getRealms().isEmpty()); Realm realm = connectedRealm.getRealms().iterator().next(); Realm createdRealm = createdConnectedRealm.getRealms().iterator().next(); assertEquals(realm.getId(), createdRealm.getId()); assertEquals(realm.getName(), createdRealm.getName()); assertEquals(realm.getSlug(), createdRealm.getSlug()); List<Realm> realms = Realm.list("connectedRealm.id", createdConnectedRealm.getId()); assertFalse(realms.isEmpty()); }