### Question:
MemUtils { public synchronized static boolean adjustMemUsage(RemoteCmdClient client, int percent, int delayMinutes) { String useageString = percent + ":" + delayMinutes; if (StringUtils.equals(useageString, "0:0")) { return false; } String scriptName = "mem.sh"; String memPID = client.getPID(scriptName); if (StringUtils.isNotBlank(memPID)) { log.error("Memory useage agent is running, can not start another one."); return false; } String scriptDir = client.getDefaultDir() + "/" + "scripts/"; InputStream is = MemUtils.class.getResourceAsStream("/" + scriptName); if (!client.createFile(is, scriptName, scriptDir)) { return false; } RemoteCmd command = new RemoteCmd(); command.addCmd(String.format("cd %s", scriptDir)); command.addCmd(String.format("chmod +x %s", scriptName)); command.addCmd(String.format("sudo /bin/sh -c \"nohup ./%s %s 5 once &\"", scriptName, useageString)); client.execCmdWithPTY(command); return true; } private  MemUtils(); synchronized static boolean adjustMemUsage(RemoteCmdClient client, int percent, 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); MemUtils.adjustMemUsage(commandExecutor, 5000, 10); }