public void testOutputStreamSuccess() throws IOException {
File target = new File(tmpdir, "target.txt");
final File tmp = new File(tmpdir, "target.txt.tmp");
createFile(target, "before");
assertEquals("before", getContent(target));
new AtomicFileWritingIdiom(target, new OutputStreamStatement() {
@Override
public void write(OutputStream os) throws IOException {
os.write("after".getBytes("ASCII"));
assertTrue("implementation of AtomicFileOutputStream has changed, update the test", tmp.exists());
}