Sample code fro Java API, written in C#