@Test
public void testClashGroupResource() throws Exception {

	System.out.println("testClashGroupResource()");
	when(am.getPerunBeanIdsForUniqueAttributeValue(eq(session), argThat(new BeanAttributeMatcher("group"))))
			.thenReturn(Sets.newHashSet(new Pair<>(55, 0)));
	Group groupWithDuplicateEmail = mock(Group.class);
	GroupsManagerBl groupsManagerBl = mock(GroupsManagerBl.class);
	when(session.getPerunBl().getGroupsManagerBl()).thenReturn(groupsManagerBl);
	when(session.getPerunBl().getGroupsManagerBl().getGroupById(session, 55)).thenReturn(groupWithDuplicateEmail);
	attributeToCheck.setValue(Lists.newArrayList("my@example.com", uco + "@muni.cz"));
	try {
		classInstance.checkAttributeSemantics(session, member, attributeToCheck);
		fail("should throw WrongReferenceAttributeValueException");
	} catch (WrongReferenceAttributeValueException ex) {
		assertThat(ex.getMessage(), endsWith("some of the email addresses are already assigned."));
	}
}