Duplicate code found in https://github.com/jberet/jsr352/blob/master/jberet-core/src/main/java/org/jberet/spi/JobExecutor.java#L93-L125