assertTrue(bm.batchOperationInProgress());
final ObjectProvider sm1 = newStateManagerMock();
final ObjectProvider sm2 = newStateManagerMock();
bm.add(sm1);
bm.add(sm2);
JDOPersistenceManager jpm = (JDOPersistenceManager) pm;
DatastoreManager dm = new DatastoreManager(
jpm.getExecutionContext().getClassLoaderResolver(), jpm.getExecutionContext().getNucleusContext(),
new HashMap<String, Object>());
bm.finish(new DatastorePersistenceHandler(dm));
assertEquals(Utils.newArrayList(sm1, sm2), providedBatchStateList);
assertFalse(bm.batchOperationInProgress());
}