### Question:
CpuUtils { public synchronized static boolean adjustCpuUsage(RemoteCmdClient client, int memUsed, int delayMinutes) { if (memUsed < 0 || delayMinutes < 0) { throw new RuntimeException("invalid params"); } String useageString = memUsed + ":" + delayMinutes; if (StringUtils.equals(useageString, "0:0")) { return false; } String scriptName = "cpu.sh"; String cpuPID = client.getPID(scriptName); if (StringUtils.isNotBlank(cpuPID)) { log.error("CPU usage agent is running, can not start another one."); return false; } String scriptDir = client.getDefaultDir() + "/" + "scripts/"; InputStream is = CpuUtils.class.getResourceAsStream("/" + scriptName); if (!client.createFile(is, scriptName, scriptDir)) { return false; } RemoteCmd remoteCmd = new RemoteCmd(); remoteCmd.addCmd(String.format("cd %s", scriptDir)); remoteCmd.addCmd(String.format("dos2unix %s", scriptName)); remoteCmd.addCmd(String.format("chmod +x %s", scriptName)); remoteCmd.addCmd(String.format("nohup ./%s %s 1 once &", scriptName, useageString)); client.execCmdWithPTY(remoteCmd); return true; } private  CpuUtils(); synchronized static boolean adjustCpuUsage(RemoteCmdClient client, int memUsed, int delayMinutes);  }### Answer:
@Test public void test() { Map<String, String> params = ((AbstractElement) this.getTestProject()).getVariables(); RemoteCmdClientConfig connectUnit = new RemoteCmdClientConfig(); connectUnit.setPassword(params.get("password")); connectUnit.setUserName(params.get("userName")); connectUnit.setIp(params.get("ip")); RemoteCmdClient commandExecutor = new RemoteCmdClient(connectUnit); CpuUtils.adjustCpuUsage(commandExecutor, 50, 10); }