ArrayList<BinPolynomial> encoded = new ArrayList<>();
ArrayList<BCHEncoderWorker> workers = new ArrayList<>();
List<Future<BinPolynomial>> futures = new ArrayList<>();
for(BinPolynomial info : notEncoded){
BCHEncoderWorker tmp = new BCHEncoderWorker(code);
tmp.setInput(info);
workers.add(tmp);
}
try {
futures = workerExecutorSvc.invokeAll(workers);