public static DistributedMember getDistributedMemberByNameOrId(String memberNameOrId,
      InternalCache cache) {
    if (memberNameOrId == null) {
      return null;
    }

    Set<DistributedMember> memberSet = getAllMembers(cache);
    return memberSet.stream().filter(member -> memberNameOrId.equalsIgnoreCase(member.getId())
        || memberNameOrId.equalsIgnoreCase(member.getName())).findFirst().orElse(null);
  }
Executes a function with arguments on a set of members, ignoring the departed members.

@param function Function to be executed.
@param args Arguments passed to the function, pass null if you wish to pass no arguments to the
       function.
@param targetMembers Set of members on which the function is to be executed.
geode-core/src/main/java/org/apache/geode/management/internal/util/ManagementUtils.java