@Override
    public Collection<MepEntry> getAllMeps(MdId mdName, MaIdShort maName)
            throws CfmConfigException {
        //Will throw IllegalArgumentException if ma does not exist
        cfmMdService.getMaintenanceAssociation(mdName, maName);

        Collection<Mep> mepStoreCollection = mepStore.getAllMeps();
        Collection<MepEntry> mepEntryCollection = new ArrayList<>();

        for (Mep mep : mepStoreCollection) {
            if (mep.mdId().equals(mdName) && mep.maId().equals(maName)) {
                DeviceId mepDeviceId = mep.deviceId();
                if (deviceService.getDevice(mepDeviceId) == null) {
                    log.warn("Device not found/available " + mepDeviceId +
                            " for MEP: " + mdName + "/" + maName + "/" + mep.mepId());
                    continue;
                } else if (!deviceService.getDevice(mepDeviceId)
                        .is(CfmMepProgrammable.class)) {
                    throw new CfmConfigException("Device " + mepDeviceId +
                            " does not support CfmMepProgrammable behaviour.");
                }

                log.debug("Retrieving MEP results for Mep {} in MD {}, MA {} "
                        + "on Device {}", mep.mepId(), mdName, maName, mepDeviceId);
                mepEntryCollection.add(deviceService
                        .getDevice(mepDeviceId)
                        .as(CfmMepProgrammable.class)
                        .getMep(mdName, maName, mep.mepId()));
            }
        }

        return mepEntryCollection;
    }
@Test
    public void testGetAllMeps() throws CfmConfigException {

        expect(mdService.getMaintenanceAssociation(MDNAME1, MANAME1))
                .andReturn(Optional.ofNullable(ma1))
                .anyTimes();
        replay(mdService);

        expect(deviceService.getDevice(DEVICE_ID1)).andReturn(device1).anyTimes();
        expect(deviceService.getDevice(DEVICE_ID2)).andReturn(device2).anyTimes();
        replay(deviceService);

        expect(driverService.getDriver(DEVICE_ID1)).andReturn(testDriver).anyTimes();
        expect(driverService.getDriver(DEVICE_ID2)).andReturn(testDriver).anyTimes();
        replay(driverService);

        Collection<MepEntry> mepEntries = mepManager.getAllMeps(MDNAME1, MANAME1);

        assertEquals(4, mepEntries.size());
    }