@Test
@Rollback(true)
public void save_cascadeMerge() {
long VALID_PREFERENCE_ID = addPreferenceToRegionWidget(VALID_REGION_WIDGET_ID);
RegionWidget regionWidget = new JpaRegionWidget();
regionWidget.setId(VALID_REGION_WIDGET_ID);
regionWidget.setPreferences(new ArrayList<RegionWidgetPreference>());
JpaRegionWidgetPreference regionWidgetPreference = new JpaRegionWidgetPreference(VALID_PREFERENCE_ID,
VALID_REGION_WIDGET_ID, VALID_PREFERENCE_NAME, VALID_PREFERENCE_VALUE);
regionWidget.getPreferences().add(regionWidgetPreference);
RegionWidget saved = repository.save(regionWidget);
manager.flush();
assertThat(saved.getPreferences().size(), is(equalTo(1)));