import java.net.URI; public class testuri { public static void main(String[] args) throws Exception { String[][] test = { {"http://example.com/", "http://example.com"}, {"HTTP://example.com/", "http://example.com/"}, {"http://example.com/", "http://example.com:/"}, {"http://example.com/", "http://example.com:80/"}, {"http://example.com/", "http://Example.com/"}, {"http://example.com/~smith/", "http://example.com/%7Esmith/"}, {"http://example.com/~smith/", "http://example.com/%7esmith/"}, {"http://example.com/%7Esmith/", "http://example.com/%7esmith/"}, {"http://example.com/%C3%87", "http://example.com/C%CC%A7"}, }; for (int i=0; i