private static MemberInfo[] GetInterfaceMembersImplementedBy([NotNull] MemberInfo member)
        {
            Fail.IfArgumentNull(member, nameof(member));
            Fail.IfArgumentNull(member.DeclaringType, nameof(member.DeclaringType));

            Type elementType = member.DeclaringType;

            Type[] interfaces = elementType.GetInterfaces();

            var property = member as PropertyInfo;

            if (property != null)
            {
                return(interfaces.Select(i => i.GetProperty(property.Name))
                       .Where(p => p != null)
                       .Cast <MemberInfo>()
                       .ToArray());
            }

            if (elementType.IsInterface)
            {
                return(new MemberInfo[0]);
            }

            var method           = member.CastOrFail <MethodInfo>();
            var interfaceMethods = new List <MethodInfo>();

            foreach (Type @interface in interfaces)
            {
                InterfaceMapping map = elementType.GetInterfaceMap(@interface);
                int elementIndex     = Array.IndexOf(map.TargetMethods, method);
                if (elementIndex == -1)
                {
                    continue;
                }

                MethodInfo interfaceMember = map.InterfaceMethods[elementIndex];
                interfaceMethods.Add(interfaceMember);
            }

            return(interfaceMethods.Cast <MemberInfo>()
                   .ToArray());
        }