test_class.declarator: mapWithUuidKey
test_class.modifier: @Mock
test_class.original_string: @Mock
  	IMap<UUID, AggregateRootHistory> mapWithUuidKey;
test_class.type: IMap<UUID, AggregateRootHistory>
test_class.var_name: mapWithUuidKey
test_class.file: myeslib-hazelcast/src/test/java/org/myeslib/hazelcast/storage/HzUnitOfWorkJournalTest.java
test_class.identifier: HzUnitOfWorkJournalTest
test_case.body: @Test(expected=ConcurrentModificationException.class)
  	public void withConcurrencyException() {
  		
  		UUID id = UUID.randomUUID();
  		Command command = new IncreaseInventory(UUID.randomUUID(), id, 1, 1L);
  		Event event1 = new InventoryIncreased(id, 1);
  		List<Event> events = Arrays.asList(event1);
  		UnitOfWork t = UnitOfWork.create(UUID.randomUUID(), command, events);
  		AggregateRootHistory toStore = new AggregateRootHistory();
  		toStore.add(t);
  		
  		when(mapWithUuidKey.get(id)).thenReturn(toStore);
  
  		HzUnitOfWorkJournal<UUID> store = new HzUnitOfWorkJournal<>(mapWithUuidKey);
  		UnitOfWork t2 = UnitOfWork.create(UUID.randomUUID(), command, events);
  		store.append(id, t2);
  
  	}
test_case.class_method_signature: HzUnitOfWorkJournalTest.withConcurrencyException()
test_case.full_signature: @Test(expected=ConcurrentModificationException.class) public void withConcurrencyException()
test_case.identifier: withConcurrencyException
test_case.invocations: randomUUID randomUUID asList create randomUUID add thenReturn when get create randomUUID append
test_case.modifiers: @Test(expected=ConcurrentModificationException.class) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void withConcurrencyException()
focal_class.declarator: pastTransactionsMap
focal_class.modifier: private final
focal_class.original_string: private final IMap<K, AggregateRootHistory> pastTransactionsMap ;
focal_class.type: IMap<K, AggregateRootHistory>
focal_class.var_name: pastTransactionsMap
focal_class.file: myeslib-hazelcast/src/main/java/org/myeslib/hazelcast/storage/HzUnitOfWorkJournal.java
focal_class.identifier: HzUnitOfWorkJournal
focal_class.interfaces: implements UnitOfWorkJournal<K>
focal_class.class_method_signature: HzUnitOfWorkJournal.HzUnitOfWorkJournal(IMap<K, AggregateRootHistory> pastTransactionsMap)
focal_class.full_signature: @Inject public  HzUnitOfWorkJournal(IMap<K, AggregateRootHistory> pastTransactionsMap)
focal_class.identifier: HzUnitOfWorkJournal
focal_class.modifiers: @Inject public
focal_class.parameters: (IMap<K, AggregateRootHistory> pastTransactionsMap)
focal_class.signature:  HzUnitOfWorkJournal(IMap<K, AggregateRootHistory> pastTransactionsMap)
focal_class.class_method_signature: HzUnitOfWorkJournal.append(final K id, final UnitOfWork uow)
focal_class.full_signature: public void append(final K id, final UnitOfWork uow)
focal_class.identifier: append
focal_class.modifiers: public
focal_class.parameters: (final K id, final UnitOfWork uow)
focal_class.return: void
focal_class.signature: void append(final K id, final UnitOfWork uow)
focal_class.class_method_signature: HzUnitOfWorkJournal.getHistoryFor(final K id)
focal_class.full_signature: private AggregateRootHistory getHistoryFor(final K id)
focal_class.identifier: getHistoryFor
focal_class.modifiers: private
focal_class.parameters: (final K id)
focal_class.return: AggregateRootHistory
focal_class.signature: AggregateRootHistory getHistoryFor(final K id)
focal_method.body: public void append(final K id, final UnitOfWork uow) {
  		checkNotNull(id);
  		checkNotNull(uow);
  		final AggregateRootHistory history = getHistoryFor(id);
  		if (!history.getLastVersion().equals(uow.getTargetVersion())){
  			throw new ConcurrentModificationException(String.format("version %s does not match the expected %s ****", 
  																	history.getLastVersion().toString(), 
  																	uow.getTargetVersion().toString())
  													 );
  														
  		} 
  		log.info("will set {}", id);
  		history.add(uow);
  		pastTransactionsMap.set(id, history); // hazelcast optimization --> set instead of put since is void
  	}
focal_method.class_method_signature: HzUnitOfWorkJournal.append(final K id, final UnitOfWork uow)
focal_method.full_signature: public void append(final K id, final UnitOfWork uow)
focal_method.identifier: append
focal_method.invocations: checkNotNull checkNotNull getHistoryFor equals getLastVersion getTargetVersion format toString getLastVersion toString getTargetVersion info add set
focal_method.modifiers: public
focal_method.parameters: (final K id, final UnitOfWork uow)
focal_method.return: void
focal_method.signature: void append(final K id, final UnitOfWork uow)