IgniteModelStorageUtil { public static <I extends Serializable, O extends Serializable> void saveModel(Ignite ignite, IgniteModel<I, O> mdl, String name) { IgniteModel<byte[], byte[]> mdlWrapper = wrapIgniteModel(mdl); byte[] serializedMdl = Utils.serialize(mdlWrapper); UUID mdlId = UUID.randomUUID(); saveModelDescriptor(ignite, name, mdlId); try { saveModelEntity(ignite, serializedMdl, mdlId); } catch (Exception e) { removeModelEntity(ignite, mdlId); throw e; } }  static void saveModel(Ignite ignite,
        IgniteModel<I, O> mdl, String name); static void removeModel(Ignite ignite, String name); static Model<I, O> getModel(Ignite ignite, String name); static Model<I, O> getSyncModel(Ignite ignite, String name,
        SyncModelBuilder mdlBldr); static Model<Vector, Future<Double>> getAsyncModel(Ignite ignite, String name, AsyncModelBuilder mdlBldr);  }
@Test(expected = IllegalArgumentException.class) public void testSaveModelWithTheSameName() throws Exception { try (Ignite ignite = startGrid(cfg)) { IgniteModelStorageUtil.saveModel(ignite, i -> 0.42, "mdl"); IgniteModelStorageUtil.saveModel(ignite, i -> 0.42, "mdl"); } }