code: public <T extends State> void deserializeFromSequenceFile(final Class<? extends Writable> keyClass,
        final Class<T> stateClass, final Path inputFilePath, final Collection<T> states, final boolean deleteAfter) {
      this.futures.add(new NamedFuture(this.executor.submit(new Callable<Void>() {
        @Override
        public Void call() throws Exception {
          Configuration conf = new Configuration(ParallelRunner.this.fs.getConf());
          WritableShimSerialization.addToHadoopConfiguration(conf);
          try (@SuppressWarnings("deprecation") SequenceFile.Reader reader = new SequenceFile.Reader(
              ParallelRunner.this.fs, inputFilePath, conf)) {
            Writable key = keyClass.newInstance();
            T state = stateClass.newInstance();
            while (reader.next(key)) {
              state = (T) reader.getCurrentValue(state);
              states.add(state);
              state = stateClass.newInstance();
            }
  
            if (deleteAfter) {
              HadoopUtils.deletePath(ParallelRunner.this.fs, inputFilePath, false);
            }
          }
  
          return null;
        }
      }), "Deserialize state from file " + inputFilePath));
    }
docs: Deserialize a list of {@link State} objects from a Hadoop {@link SequenceFile}.
  
  <p>
  This method submits a task to deserialize the {@link State} objects and returns immediately
  after the task is submitted.
  </p>
  
  @param stateClass the {@link Class} object of the {@link State} class
  @param inputFilePath the input {@link SequenceFile} to read from
  @param states a {@link Collection} object to store the deserialized {@link State} objects
  @param deleteAfter a flag telling whether to delete the {@link SequenceFile} afterwards
  @param <T> the {@link State} object type