@Test
public void connect() throws IOException {

    NPipeSocketImpl impl = new NPipeSocketImpl();
    assertThatExceptionOfType(SocketException.class)
            .isThrownBy(() -> impl.connect(new InetSocketAddress(InetAddress.getLocalHost(), 80), 0));
    assertThatExceptionOfType(NoSuchFileException.class)
            .isThrownBy(() -> impl.connect(new NPipeSocketAddress(Paths.get("/non_existing_file")), 0));
    assertThatExceptionOfType(NullPointerException.class)
            .isThrownBy(() -> impl.connect((SocketAddress) null, 0));
    impl.connect(createTestSocket(), 0);
}