@Test
public void testProfileWithMediumCombinedAndFilterMedium() throws Exception {

    // SETUP
    final Integer channel = null;
    final Medium filterMedium = Medium.ELECTRICITY;
    final List<DlmsCaptureObject> expectedSelectedObjects = this.captureObjectsCombined.stream()
            .filter(c -> !(c.getRelatedObject() instanceof DlmsRegister)
                    || ((DlmsRegister) c.getRelatedObject()).getMedium() == filterMedium)
            .collect(Collectors.toList());
    final DataObject selectedValues = DataObject.newArrayData(expectedSelectedObjects.stream()
            .map(o -> this.getDataObject(o.getRelatedObject()))
            .collect(Collectors.toList()));
    final DataObject accessParams = this.getAccessParams(selectedValues);
    final SelectiveAccessDescription access = new SelectiveAccessDescription(1, accessParams);
    final AttributeAddress expectedAddress = new AttributeAddress(this.profileCombined.getClassId(),
            this.profileCombined.getObisCodeAsString(), this.profileCombined.getDefaultAttributeId(), access);
    // CALL
    final Optional<AttributeAddressForProfile> attributeAddressForProfile = this.service
            .findAttributeAddressForProfile(this.device422, DlmsObjectType.DAILY_LOAD_PROFILE, channel, this.from,
                    this.to, filterMedium);
    // VERIFY
    AttributeAddressAssert.is(attributeAddressForProfile.get()
            .getAttributeAddress(), expectedAddress);
    assertThat(attributeAddressForProfile.get()
            .getSelectedObjects()).isEqualTo(expectedSelectedObjects);
}