I would like to test a public method1 as well as mock the private method createJSON of Singleton class.
public class SingletonClass {
    private static SingletonClass singletonInstance = new SingletonClass();
    private SingletonClass() {
    }
    public static SingletonClass getInstance() {
        return singletonInstance;
    }
    public JSONObject method1(int id, String str)
        throws JSONException {
        JSONObject loginJSON = createJSON(id, str);
        return loginJSON;
    }
    private JSONObject createJSON(int id, String str){
        return new JSONObject().put("id", id).put("str", str);
    }
}
Could anyone help on this?
 
     
    