@Test
public void testReferenceRetry() {

    ApplicationConfig application = new ApplicationConfig();
    application.setName("test-reference-retry");
    RegistryConfig registry = new RegistryConfig();
    registry.setAddress("multicast://224.5.6.7:1234");
    ProtocolConfig protocol = new ProtocolConfig();
    protocol.setName("mockprotocol");
    ReferenceConfig<DemoService> rc = new ReferenceConfig<DemoService>();
    rc.setApplication(application);
    rc.setRegistry(registry);
    rc.setInterface(DemoService.class.getName());
    boolean success = false;
    DemoService demoService = null;
    try {
        demoService = rc.get();
        success = true;
    } catch (Exception e) {
        e.printStackTrace();
    }
    Assertions.assertFalse(success);
    Assertions.assertNull(demoService);
    ServiceConfig<DemoService> sc = new ServiceConfig<DemoService>();
    sc.setInterface(DemoService.class);
    sc.setRef(new DemoServiceImpl());
    sc.setApplication(application);
    sc.setRegistry(registry);
    sc.setProtocol(protocol);
    try {
        System.setProperty("java.net.preferIPv4Stack", "true");
        sc.export();
        demoService = rc.get();
        success = true;
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        System.clearProperty("java.net.preferIPv4Stack");
    }
    Assertions.assertTrue(success);
    Assertions.assertNotNull(demoService);
}