@SuppressWarnings("unchecked")
@Test 
public void testInternalClose() throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, InvocationTargetException, NoSuchMethodException, SQLException{

	ConcurrentLinkedQueue<Statement> mockStatementHandles = createNiceMock(ConcurrentLinkedQueue.class);
	StatementHandle mockStatement = createNiceMock(StatementHandle.class);
	this.mockConnection.close();
	expectLastCall().once().andThrow(new SQLException()).once();
	Map<Connection, Reference<ConnectionHandle>> refs = new HashMap<Connection, Reference<ConnectionHandle>>();
	expect(this.mockPool.getFinalizableRefs()).andReturn(refs).anyTimes();
	FinalizableReferenceQueue finalizableRefQueue = new FinalizableReferenceQueue();
	expect(this.mockPool.getFinalizableRefQueue()).andReturn(finalizableRefQueue).anyTimes();
	expect(this.mockConnection.getPool()).andReturn(this.mockPool).anyTimes();
	Field f = this.testClass.getClass().getDeclaredField("finalizableRefs");
	f.setAccessible(true);
	f.set(this.testClass, refs);
	replay(mockStatement, this.mockConnection, mockStatementHandles, this.mockPool);
	this.testClass.internalClose();
	try{
		this.testClass.internalClose(); //2nd time should throw exception
		fail("Should have thrown an exception");
	} catch (Throwable t){
		// do nothing.
	}
	verify(mockStatement, this.mockConnection, mockStatementHandles);
}