/* @test
 */

 import java.io.*;
import java.net.*;

public class OpenStream {

    public static void main(String[] args) throws IOException {
        testMalformedURL();
    }

    static void testMalformedURL() {
        // Test behavior with obviously malformed URL
        try {
            URL u = new URL("http:///path-without-host");
            u.openConnection(Proxy.NO_PROXY).getInputStream();
            throw new RuntimeException("Expected MalformedURLException or similar error");
        } catch (MalformedURLException e) {
            System.out.println("MalformedURLException thrown as expected: " + e.getMessage());
        } catch (IOException e) {
            // Other IOExceptions are acceptable for malformed URLs
            System.out.println("IOException thrown for malformed URL: " + e.getClass().getSimpleName() + ": " + e.getMessage());
        }
    }
}