@Test
    public void testGC() throws Exception {
        String url = "localhost:3333?k1=v1&k2=v2";

        Constructor con = Url.class.getDeclaredConstructor(new Class[] { String.class });
        con.setAccessible(true);

        long start = System.currentTimeMillis();
        long MAX_TIME_ELAPSED = 10 * 1000;
        Url urlObject = null;
        while (!Url.isCollected) {
            urlObject = (Url) con.newInstance((String) url);
            Url.parsedUrls.put(url, new SoftReference<Url>(urlObject));

            if ((System.currentTimeMillis() - start) > MAX_TIME_ELAPSED) {
                Assert.fail("GC should have already been called!");
                break;
            }
        }
    }
Test basic usage of url

@author xiaomin.cxm
@version $Id: UrlTest.java, v 0.1 Apr 18, 2016 7:22:01 PM xiaomin.cxm Exp $
src/test/java/com/alipay/remoting/inner/connection/UrlTest.java