@Test
public void testObtainAndReleaseLocks() {
PessimisticLockManager manager = new PessimisticLockManager();
UUID identifier = UUID.randomUUID();
AggregateRoot aggregateRoot = mock(AggregateRoot.class);
when(aggregateRoot.getIdentifier()).thenReturn(identifier);
assertFalse(manager.validateLock(aggregateRoot));
manager.obtainLock(identifier);
assertTrue(manager.validateLock(aggregateRoot));