Control Adapter example with code