Example updated to support same functionality than Java and C#.