DockerCommandExecutor { public static boolean isRemovable(DockerContainerStatus containerStatus) { return !containerStatus.equals(DockerContainerStatus.NONEXISTENT) && !containerStatus.equals(DockerContainerStatus.UNKNOWN) && !containerStatus.equals(DockerContainerStatus.REMOVING) && !containerStatus.equals(DockerContainerStatus.RUNNING); } private  DockerCommandExecutor(); static String executeDockerCommand(DockerCommand dockerCommand,
      String containerId, Map<String, String> env,
      PrivilegedOperationExecutor privilegedOperationExecutor,
      boolean disableFailureLogging, Context nmContext); static DockerContainerStatus getContainerStatus(String containerId,
      PrivilegedOperationExecutor privilegedOperationExecutor,
      Context nmContext); static DockerContainerStatus parseContainerStatus(
      String containerStatusStr); static boolean isStoppable(DockerContainerStatus containerStatus); static boolean isKillable(DockerContainerStatus containerStatus); static boolean isRemovable(DockerContainerStatus containerStatus); static boolean isStartable(DockerContainerStatus containerStatus);  }
@Test public void testIsRemovable() { assertTrue(DockerCommandExecutor.isRemovable( DockerContainerStatus.STOPPED)); assertTrue(DockerCommandExecutor.isRemovable( DockerContainerStatus.RESTARTING)); assertTrue(DockerCommandExecutor.isRemovable( DockerContainerStatus.EXITED)); assertTrue(DockerCommandExecutor.isRemovable( DockerContainerStatus.CREATED)); assertTrue(DockerCommandExecutor.isRemovable( DockerContainerStatus.DEAD)); assertFalse(DockerCommandExecutor.isRemovable( DockerContainerStatus.NONEXISTENT)); assertFalse(DockerCommandExecutor.isRemovable( DockerContainerStatus.REMOVING)); assertFalse(DockerCommandExecutor.isRemovable( DockerContainerStatus.UNKNOWN)); assertFalse(DockerCommandExecutor.isRemovable( DockerContainerStatus.RUNNING)); }