code: private boolean isInstanceStopped(Instance myInstance) {
          InstanceState instanceState = myInstance.getState();
          return (instanceState.getName().equals("stopped"));
      }
docs: /*
  Returns true if instance is stopped. Other possible states include
  pending, running, shutting-down, terminated, stopping