Field field = testClass.getClass().getDeclaredField("statsLock");
field.setAccessible(true);
ReentrantReadWriteLock oldLock = (ReentrantReadWriteLock) field.get(testClass);
field.set(testClass, mockLock);
expect(mockLock.writeLock()).andThrow(new RuntimeException()).once().andReturn(mockWriteLock).once();
mockWriteLock.lock();
expectLastCall().once();
replay(mockLock, mockWriteLock);
try{
testClass.updateCreatedConnections(5);