How to test IOException for a JSONObject?

I have the code below:

public static void writeJson(JSONObject outputFinal) throws IOException {
    fw.write(outputFinal.toString(3));
    fw.flush();
    fw.close();
}

I am trying to write a JUnit test to test the IOException.
How can I make the JSONObject passed as a param trigger an exception?