ThreadedModelBuilder implements AsyncModelBuilder { @Override public <I extends Serializable, O extends Serializable> Model<I, Future<O>> build( ModelReader reader, ModelParser<I, O, ?> parser) { return new ThreadedInfModel<>(parser.parse(reader.read()), threads); } ThreadedModelBuilder(int threads); @Override Model<I, Future<O>> build(
        ModelReader reader, ModelParser<I, O, ?> parser);  }
@Test public void testBuild() throws ExecutionException, InterruptedException { AsyncModelBuilder mdlBuilder = new ThreadedModelBuilder(10); Model<Integer, Future<Integer>> infMdl = mdlBuilder.build( ModelBuilderTestUtil.getReader(), ModelBuilderTestUtil.getParser() ); for (int i = 0; i < 100; i++) assertEquals(Integer.valueOf(i), infMdl.predict(i).get()); }