@Test
public void MustCorrectCompileQuery() throws Exception {

    QueryStatement statement = mock(QueryStatement.class);
    PreparedStatement preparedStatement = mock(PreparedStatement.class);
    JDBCCompiledQuery query = mock(JDBCCompiledQuery.class);
    when(statement.compile(connection)).thenReturn(preparedStatement);
    whenNew(JDBCCompiledQuery.class).withArguments(preparedStatement).thenReturn(query);
    assertTrue(testPostgresConnection.compileQuery(statement) == query);
    verify(statement).compile(connection);
    verifyNew(JDBCCompiledQuery.class).withArguments(preparedStatement);
}