@Test(expected = WrongReferenceAttributeValueException.class)
public void testGroupWithSameGIDAndNoRightsToUseIt() throws Exception {

	System.out.println("testGroupWithSameGIDAndNoRightsToUseIt()");
	attributeToCheck.setValue("my name");
	Group group2 = new Group();
	List<Group> listOfGroups = new ArrayList<>();
	listOfGroups.add(group2);
	when(sess.getPerunBl().getGroupsManagerBl().getGroupsByAttribute(sess, attributeToCheck)).thenReturn(listOfGroups);
	when(sess.getPerunBl().getAttributesManagerBl().getAllAttributesStartWithNameWithoutNullValue(sess, resource, AttributesManager.NS_RESOURCE_ATTR_DEF + ":unixGID-namespace:")).thenReturn(Collections.singletonList(attributeToCheck));
	when(sess.getPerunBl().getModulesUtilsBl().haveRightToWriteAttributeInAnyGroupOrResource(sess, listOfGroups, new ArrayList<>(), attributeToCheck, attributeToCheck)).thenReturn(false);
	classInstance.checkAttributeSemantics(sess, resource, attributeToCheck);
}