void () { doTest( """ import java.nio.channels.FileChannel; import java.nio.ByteBuffer; import java.io.IOException; class X { public static void withoutSideEffects(FileChannel fch, ByteBuffer[] srcs) throws IOException { fch./*Result of 'FileChannel.write()' is ignored*/write/**/(srcs); } public static long useResult(FileChannel fch, ByteBuffer[] srcs) throws IOException { return fch.write(srcs); } public static void hasSideEffect(FileChannel fch, ByteBuffer[] srcs) throws IOException { do{ fch.write(srcs); } while (test(srcs)); } public static boolean test(ByteBuffer[] srcs){ return srcs[0].hasRemaining(); } } """); }