@Override
      public void onCommandResult(int commandCode, int exitCode, List<String> stdout) {
        Console.this.exitCode = exitCode;
        Console.this.stdout = stdout;
        synchronized (callbackThread) {
          isCommandRunning = false;
          callbackThread.notifyAll();
        }
      }
Class that creates an {@link Interactive} shell and handles the callbacks and threads for you.
imitate/src/main/java/com/engineer/imitate/shell/Shell.java