LockRequestBuilder bldr = new LockRequestBuilder();
LockComponent comp = new LockComponent(LockType.SHARED_READ, LockLevel.DB, "mydb");
bldr.addLockComponent(comp);
comp = new LockComponent(LockType.SHARED_WRITE, LockLevel.DB, "mydb");
bldr.addLockComponent(comp).setUser("fred");
LockRequest req = bldr.build();
List<LockComponent> locks = req.getComponent();
Assert.assertEquals(1, locks.size());
Assert.assertEquals(LockType.SHARED_WRITE, locks.get(0).getType());
}