@Test
public void testCreate() {

    Proxy proxy = Proxy.create(URI.create("//127.0.0.1:8080"));
    assertNull(proxy.getScheme());
    assertNull(proxy.getUsername());
    assertNull(proxy.getPassword());
    assertEquals("127.0.0.1", proxy.getHost());
    assertEquals(8080, proxy.getPort());
    proxy = Proxy.create(URI.create("http://127.0.0.1:8080"));
    assertEquals("http", proxy.getScheme());
    assertNull(proxy.getUsername());
    assertNull(proxy.getPassword());
    assertEquals("127.0.0.1", proxy.getHost());
    assertEquals(8080, proxy.getPort());
    proxy = Proxy.create(URI.create("//username:password@127.0.0.1:8080"));
    assertNull(proxy.getScheme());
    assertEquals("username", proxy.getUsername());
    assertEquals("password", proxy.getPassword());
    assertEquals("127.0.0.1", proxy.getHost());
    assertEquals(8080, proxy.getPort());
    proxy = Proxy.create(URI.create("//username@127.0.0.1:8080"));
    assertNull(proxy.getScheme());
    assertEquals("username", proxy.getUsername());
    assertNull(proxy.getPassword());
    assertEquals("127.0.0.1", proxy.getHost());
    assertEquals(8080, proxy.getPort());
    proxy = Proxy.create(URI.create("//:password@127.0.0.1:8080"));
    assertNull(proxy.getScheme());
    assertNull(proxy.getUsername());
    assertEquals("password", proxy.getPassword());
    assertEquals("127.0.0.1", proxy.getHost());
    assertEquals(8080, proxy.getPort());
}