When you break the inheritance, try to use
SPGroup contributeGroup = web.SiteGroups["TestSiteMember"];
properties.ListItem.BreakRoleInheritance(false);
Setting the BreakRoleInheritance(false) will not copy the inherited roles to the item and then you can add the permissions you want to afresh using
properties.ListItem.RoleAssignments.Add()
Hope this helps.