@Test
public void testCreateObjectStore() throws Exception {

    Persistence<Car, Integer> persistence1 = mockPersistence("persistence1");
    Persistence<Car, Integer> persistence2 = mockPersistence("persistence2");
    Persistence<Car, Integer> persistence3 = mockPersistence("persistence3");
    when(persistence1.getPrimaryKeyAttribute()).thenReturn(Car.CAR_ID);
    when(persistence2.getPrimaryKeyAttribute()).thenReturn(Car.CAR_ID);
    when(persistence3.getPrimaryKeyAttribute()).thenReturn(Car.CAR_ID);
    ObjectStore<Car> objectStore = new ConcurrentOnHeapObjectStore<Car>();
    when(persistence1.createObjectStore()).thenReturn(objectStore);
    CompositePersistence<Car, Integer> compositePersistence = new CompositePersistence<Car, Integer>(persistence1, persistence2, singletonList(persistence3));
    ObjectStore<Car> result = compositePersistence.createObjectStore();
    assertEquals(objectStore, result);
}