@Test
public void getOutputStream() throws IOException {

	File tmpFile = File.createTempFile("unittest", ".txt");   //$NON-NLS-1$ //$NON-NLS-2$
	tmpFile.deleteOnExit();
	URLConnection con = new URLConnection(tmpFile.toURI().toURL());
	con.setDoOutput(true);
	try (OutputStream os = con.getOutputStream()) {
		try (OutputStreamWriter osw = new OutputStreamWriter(os)) {
			try (BufferedWriter bw = new BufferedWriter(osw)) {
				bw.write("HELLO WORLD!");  //$NON-NLS-1$
			}
		}
	}
	assertEquals(12, tmpFile.length());
	String line;
	try (BufferedReader br = new BufferedReader(new FileReader(tmpFile))) {
		line = br.readLine();
	}
	assertEquals("HELLO WORLD!", line);  //$NON-NLS-1$
}