Data structure for efficient group lookup
If the groups are static, your data structure is perfectly reasonable.
You can also consider the Union-Find data structure.  Find is the getGroupOf operation.  It is quite fast, and also allows you to modify the data structure by merging groups and adding a new item in its own group.