### Question:
RelationshipEditionDialog implements PropertyEditionPopup { void enableRelationDependentFields(RelationType relationType) { if (relationType != null) { switch (relationType) { case ONE_TO_ONE: view.setOptionalVisible(true); view.setMappedByVisible(true); view.setOrphanRemovalVisible(true); break; case ONE_TO_MANY: view.setOptionalVisible(false); view.setMappedByVisible(true); view.setOrphanRemovalVisible(true); break; case MANY_TO_ONE: view.setOptionalVisible(true); view.setMappedByVisible(false); view.setOrphanRemovalVisible(false); break; case MANY_TO_MANY: view.setOptionalVisible(false); view.setMappedByVisible(true); view.setOrphanRemovalVisible(false); } } } @Inject  RelationshipEditionDialog(View view); @Override Widget asWidget(); @Override @SuppressWarnings("unchecked") void show(); @Override void setOkCommand(Command okCommand); @Override void setProperty(PropertyEditorFieldInfo property); @Override String getStringValue(); @Override void setStringValue(String value);  }### Answer:
@Test public void testRelationDependentFieldsOneToOne() { dialog.enableRelationDependentFields(RelationType.ONE_TO_ONE); verifyRelationDependentFields(RelationType.ONE_TO_ONE); }
@Test public void testRelationDependentFieldsOneToMany() { dialog.enableRelationDependentFields(RelationType.ONE_TO_MANY); verifyRelationDependentFields(RelationType.ONE_TO_MANY); }
@Test public void testRelationDependentFieldsManyToOne() { dialog.enableRelationDependentFields(RelationType.MANY_TO_ONE); verifyRelationDependentFields(RelationType.MANY_TO_ONE); }
@Test public void testRelationDependentFieldsManyToMany() { dialog.enableRelationDependentFields(RelationType.MANY_TO_MANY); verifyRelationDependentFields(RelationType.MANY_TO_MANY); }