@Test
public void testSynchronize() {

    ThingTypeUID thingTypeUID = new ThingTypeUID("bindingId", "thingType");
    Map<String, Object> discoveryResultSourceMap = new HashMap<>();
    discoveryResultSourceMap.put("ipAddress", "127.0.0.1");
    DiscoveryResultImpl discoveryResult = new DiscoveryResultImpl(thingTypeUID,
            new ThingUID(thingTypeUID, "thingId"), null, discoveryResultSourceMap, "ipAddress", "TARGET",
            DEFAULT_TTL);
    discoveryResult.setFlag(DiscoveryResultFlag.IGNORED);
    Map<String, Object> discoveryResultMap = new HashMap<>();
    discoveryResultMap.put("ipAddress", "192.168.178.1");
    discoveryResultMap.put("macAddress", "AA:BB:CC:DD:EE:FF");
    DiscoveryResultImpl discoveryResultSource = new DiscoveryResultImpl(thingTypeUID,
            new ThingUID(thingTypeUID, "thingId"), null, discoveryResultMap, "macAddress", "SOURCE", DEFAULT_TTL);
    discoveryResultSource.setFlag(DiscoveryResultFlag.NEW);
    discoveryResult.synchronize(discoveryResultSource);
    assertEquals("192.168.178.1", discoveryResult.getProperties().get("ipAddress"));
    assertEquals("AA:BB:CC:DD:EE:FF", discoveryResult.getProperties().get("macAddress"));
    assertEquals("macAddress", discoveryResult.getRepresentationProperty());
    assertEquals("SOURCE", discoveryResult.getLabel());
    assertEquals(DiscoveryResultFlag.IGNORED, discoveryResult.getFlag());
}