code: protected void verifyStatusTransitionIsValid(JobInstanceEntity instance, BatchStatus toStatus) throws BatchIllegalJobStatusTransitionException {
  
          switch (instance.getBatchStatus()) {
              case COMPLETED:
                  //COMPLETED to ABANDONED is allowed since it's already allowed in released TCK tests.
                  if (toStatus == BatchStatus.ABANDONED) {
                      break;
                  }
              case ABANDONED:
                  throw new BatchIllegalJobStatusTransitionException("Job instance: " + instance.getInstanceId()
                                                                     + " cannot be transitioned from Batch Status: " + instance.getBatchStatus().name()
                                                                     + " to " + toStatus.name());
              case STARTING:
              case STARTED:
              case STOPPING:
              case FAILED:
  
              default:
          }
  
      }
docs: See description of: {@link AbstractPersistenceManager#verifyStatusTransitionIsValid(JobExecutionEntity, BatchStatus)
  
  @param instance
  @param toStatus
  @throws BatchIllegalJobStatusTransitionException