Scala use Redis client Lettuce with Runtime error of type mismatch for GenericObjectPoolConfig

The scala code below try using Redis client Lettuce to get connection. But runtime has the following runtime mistype error.

    val config = new GenericObjectPoolConfig()
    config.setMinIdle(2)
    val pool = ConnectionPoolSupport.createGenericObjectPool(() => redisClient.connect, config)
    try {
      val poolConnection:StatefulRedisConnection[String, String] = pool.asInstanceOf[GenericObjectPool[StatefulRedisConnection[String, String]]].borrowObject
      try {
        val commands:RedisAsyncCommands[String, String] = poolConnection.async()
        commands.multi
        commands.set("test-key", "test-value")
        commands.exec
      } finally if (poolConnection != null) poolConnection.close()
    }

Got error below:

type mismatch;
 found   : org.apache.commons.pool2.impl.GenericObjectPoolConfig
 required: org.apache.commons.pool2.impl.GenericObjectPoolConfig[io.lettuce.core.api.StatefulRedisConnection[String,String]]
    val pool:GenericObjectPool[StatefulRedisConnection[String, String]] = ConnectionPoolSupport.createGenericObjectPool(() => redisClient.connect, config)