public DistributedMember getMember(final String memberName) {
    DistributedMember member = findMember(memberName);

    if (member == null) {
      throw new EntityNotFoundException(
          CliStrings.format(CliStrings.MEMBER_NOT_FOUND_ERROR_MESSAGE, memberName));
    }
    return member;
  }
this either returns a non-null member or throw an exception if member is not found.

@param memberName the member name of the member to find
@return the member
geode-gfsh/src/main/java/org/apache/geode/management/cli/GfshCommand.java