@SuppressWarnings("unchecked")
    @Override
    public AcknowledgementService handle(LocalDevice localDevice, Address from, OctetString linkService)
            throws BACnetException {
        BACnetObject obj = localDevice.getObject(objectIdentifier);
        if (obj == null)
            throw createException(ErrorClass.property, ErrorCode.writeAccessDenied, new UnsignedInteger(1));

        Encodable e;
        try {
            e = obj.getProperty(propertyIdentifier, propertyArrayIndex);
        }
        catch (BACnetServiceException ex) {
            throw createException(ErrorClass.property, ErrorCode.invalidArrayIndex, new UnsignedInteger(1));
        }
        if (!(e instanceof SequenceOf<?>))
            throw createException(ErrorClass.property, ErrorCode.propertyIsNotAnArray, new UnsignedInteger(1));

        SequenceOf<Encodable> propList = (SequenceOf<Encodable>) e;

        PropertyValue pv = new PropertyValue(propertyIdentifier, propertyArrayIndex, listOfElements, null);
        if (localDevice.getEventHandler().checkAllowPropertyWrite(obj, pv)) {
            for (int i = 1; i <= propList.getCount(); i++) {
                Encodable prop = propList.get(i);
                if (prop != null) {
                    for (Encodable rem : listOfElements) {
                        if (prop.equals(rem))
                            propList.remove(i);
                    }
                }
            }
            localDevice.getEventHandler().propertyWritten(obj, pv);
        }
        else
            throw createException(ErrorClass.property, ErrorCode.writeAccessDenied, new UnsignedInteger(1));

        return null;
    }