s.close();
int index = 0;
if ( ( ( PersistentCollection ) parent.getChildren() ).wasInitialized() ) {
checkResult( listeners, listeners.getInitializeCollectionListener(), parent, index++ );
}
ChildWithBidirectionalManyToMany childWithManyToMany = null;
if ( child instanceof ChildWithBidirectionalManyToMany ) {
childWithManyToMany = ( ChildWithBidirectionalManyToMany ) child;
if ( ( ( PersistentCollection ) childWithManyToMany.getParents() ).wasInitialized() ) {
checkResult( listeners, listeners.getInitializeCollectionListener(), childWithManyToMany, index++ );
}
}
if ( !( parent.getChildren() instanceof PersistentSet ) ) {
checkResult( listeners, listeners.getPreCollectionUpdateListener(), parent, index++ );
checkResult( listeners, listeners.getPostCollectionUpdateListener(), parent, index++ );
}
if ( childWithManyToMany != null && !( childWithManyToMany.getParents() instanceof PersistentSet ) ) {
checkResult( listeners, listeners.getPreCollectionUpdateListener(), childWithManyToMany, index++ );
checkResult( listeners, listeners.getPostCollectionUpdateListener(), childWithManyToMany, index++ );
}
checkNumberOfResults( listeners, index );
}