Added a full code example

Change-Id: I804a814017e675c5a90683027718056b3ee2c610
These methods can be private

Change-Id: Ia309b207a2e36b7556345c1148f0375fd63c7539