@Override
    public ConfigurationChanges merge(Device device, EnumSet<Option> options) throws ConfigurationException {
        ConfigurationChanges diffs = configurationChangesOf(options);
        merge(device, options, diffs);
        return diffs;
    }
@Test
    public void testMerge() throws Exception {
        try {
            config.removeDevice("Test-Device-1", null);
        }  catch (ConfigurationNotFoundException e) {}
        Device device = createDevice("Test-Device-1", "TEST-AET1");
        config.persist(device, null);
        modifyDevice(device);
        config.merge(device, null);
        ApplicationEntity ae2 = config.findApplicationEntity("TEST-AET2");
        ApplicationEntity ae = ae2.getDevice().getApplicationEntity("TEST-AET1");
        assertTrue(ae.isAssociationInitiator());
        assertFalse(ae.isAssociationAcceptor());
        assertFalse(ae.getConnections().get(0).isServer());
        TransferCapability echoSCP = ae.getTransferCapabilityFor(
                UID.Verification, TransferCapability.Role.SCP);
        assertNull(echoSCP);
        TransferCapability echoSCU = ae.getTransferCapabilityFor(
                UID.Verification, TransferCapability.Role.SCU);
        assertNotNull(echoSCU);
        TransferCapability ctSCP = ae.getTransferCapabilityFor(
                UID.CTImageStorage, TransferCapability.Role.SCP);
        assertEquals(STORAGE_OPTIONS, ctSCP.getStorageOptions());
        TransferCapability findSCP = ae.getTransferCapabilityFor(
                UID.StudyRootQueryRetrieveInformationModelFind, TransferCapability.Role.SCP);
        assertEquals(EnumSet.of(QueryOption.RELATIONAL, QueryOption.DATETIME),
                findSCP.getQueryOptions());
        config.removeDevice("Test-Device-1", null);
    }