Unfortunately, I dont have this available, but here is what you can do:
1. Query all the groups from the database using QuerySpec apis (you can search for QuerySpec in Windchill javadocs).
2. For each group, get all the members using WTGroup's members() method.
3. What you would get in the enumeration would be a WTPrincipal reference, and a WTPrincipal could either be a WTUser or WTGroup. If the it is WTUser, you have got a user and if its WTGroup, you have got a nest group and can get the members for this group too.