Added Gateway example

The Gateway Javadoc now provides a sample implementation to demonstrate
its use and benefits.