    @Test
    public void testInheritParticipantsFromAssignedObject()
    {

        final Long objectId = 1L;

        final String participantLdapId = "userId2";
        final String participantType = "write";

        final String participantLdapId1 = "userId1";
        final String participantType1 = "assignee";
        final String participantLdapId2 = "userId2";
        final String participantType2 = "assignee";
        final String participantLdapId3 = "userId3";
        final String participantType3 = "owning group";

        expect(ecmFileConfigMock.getFileParticipant("write")).andReturn("assignee,owner").anyTimes();
        expect(ecmFileConfigMock.getFileParticipant("read")).andReturn("follower,reader").anyTimes();
        expect(ecmFileConfigMock.getFileParticipant("no-access")).andReturn("No Access").anyTimes();
        expect(ecmFileConfigMock.getFileParticipant("group-write")).andReturn("owning group").anyTimes();
        expect(ecmFileConfigMock.getFileParticipant("group-read")).andReturn("follower group").anyTimes();
        expect(ecmFileConfigMock.getFileParticipant("*")).andReturn("*").anyTimes();
        expect(ecmFileConfigMock.getFileParticipant("group-no-access")).andReturn("owning group").anyTimes();

        AcmContainer acmContainer = new AcmContainer();
        AcmFolder acmFolder = new AcmFolder();
        acmFolder.setId(objectId);

        acmContainer.setFolder(acmFolder);

        List<AcmParticipant> assignedObjectParticipants = new ArrayList<>();
        AcmParticipant participantAssign1 = new AcmParticipant();
        participantAssign1.setParticipantLdapId(participantLdapId1);
        participantAssign1.setParticipantType(participantType1);
        participantAssign1.setReplaceChildrenParticipant(true);
        assignedObjectParticipants.add(participantAssign1);

        AcmParticipant participantAssign2 = new AcmParticipant();
        participantAssign2.setParticipantLdapId(participantLdapId3);
        participantAssign2.setParticipantType(participantType3);
        participantAssign2.setReplaceChildrenParticipant(false);
        assignedObjectParticipants.add(participantAssign2);

        List<AcmParticipant> orignalObjectParticipants = new ArrayList<>();
        AcmParticipant participantOrig1 = new AcmParticipant();
        participantOrig1.setParticipantLdapId(participantLdapId2);
        participantOrig1.setParticipantType(participantType2);
        participantOrig1.setReplaceChildrenParticipant(false);
        orignalObjectParticipants.add(participantOrig1);

        AcmParticipant participantOrig2 = new AcmParticipant();
        participantOrig2.setParticipantLdapId(participantLdapId3);
        participantOrig2.setParticipantType(participantType3);
        participantOrig2.setReplaceChildrenParticipant(false);
        orignalObjectParticipants.add(participantOrig1);

        EcmFile file = new EcmFile();

        AcmParticipant childFolderParticipant = new AcmParticipant();
        childFolderParticipant.setParticipantLdapId(participantLdapId);
        childFolderParticipant.setParticipantType(participantType);

        expect(mockFileDao.findByFolderId(acmFolder.getId(), FlushModeType.COMMIT)).andReturn(Arrays.asList(file));
        expect(mockFileDao.save(file)).andReturn(file);

        EntityManager em = mock(EntityManager.class);
        expect(mockFolderDao.getEm()).andReturn(em).anyTimes();

        expect(mockFolderDao.findSubFolders(objectId, FlushModeType.COMMIT)).andReturn(new ArrayList<>());

        // when
        replayAll();
        fileParticipantService.inheritParticipantsFromAssignedObject(assignedObjectParticipants, orignalObjectParticipants, acmContainer,
                false);

        verifyAll();
        // then
        assertEquals(participantLdapId1, file.getParticipants().get(0).getParticipantLdapId());
    }