Programming, test Group owner

How to check if an user is a group owner ?