void (String command) { EvaluationCallback<String> callback = new EvaluationCallback<>(); myDebugProcess.consoleExec(command, new PyDebugCallback<>() { @Override public void ok(String value) { callback.evaluated(value); } @Override public void error(PyDebuggerException exception) { callback.errorOccurred(exception.getMessage()); } }); callback.waitFor(XDebuggerTestUtil.TIMEOUT_MS); }