### Question:
ErrorManageUtil { public static void writeErrorFile(){ try{ FileManager.generateErrorFile(errorMap); }catch(Exception e){ log.error("Error in writeErrorFile",e); } } private  ErrorManageUtil(); static void initialise(); static void finalise(); static synchronized void uploadError(String account, String region, String type, String exception); static void writeErrorFile(); static Map<String,Object> formErrorCode();  }### Answer:
@SuppressWarnings("static-access") @Test public void writeErrorFileTest() throws Exception{ mockStatic(FileManager.class); PowerMockito.doNothing().when(FileManager.class,"generateErrorFile",anyMap()); errorManageUtil.writeErrorFile(); PowerMockito.doThrow(new IOException()).when(FileManager.class,"generateErrorFile",anyMap()); errorManageUtil.writeErrorFile(); }