static MemberMap cloneExcluding(MemberMap source, MemberImpl... excludeMembers) {
        if (source.size() == 0) {
            return source;
        }

        Map<Address, MemberImpl> addressMap = new LinkedHashMap<>(source.addressToMemberMap);
        Map<String, MemberImpl> uuidMap = new LinkedHashMap<>(source.uuidToMemberMap);

        for (MemberImpl member : excludeMembers) {
            MemberImpl removed = addressMap.remove(member.getAddress());
            if (removed != null) {
                uuidMap.remove(removed.getUuid());
            }

            removed = uuidMap.remove(member.getUuid());
            if (removed != null) {
                addressMap.remove(removed.getAddress());
            }
        }

        return new MemberMap(source.version + excludeMembers.length, addressMap, uuidMap);
    }
static MemberMap cloneExcluding ( MemberMap source , MemberImpl ... excludeMembers ) { if ( source . size ( ) == 0 ) { return source ; } Map < Address , MemberImpl > addressMap = new LinkedHashMap < > ( source . addressToMemberMap ) ; Map < String , MemberImpl > uuidMap = new LinkedHashMap < > ( source . uuidToMemberMap ) ; for ( MemberImpl member : excludeMembers ) { MemberImpl removed = addressMap . remove ( member . getAddress ( ) ) ; if ( removed != null ) { uuidMap . remove ( removed . getUuid ( ) ) ; } removed = uuidMap . remove ( member . getUuid ( ) ) ; if ( removed != null ) { addressMap . remove ( removed . getAddress ( ) ) ; } } return new MemberMap ( source . version + excludeMembers . length , addressMap , uuidMap ) ; }
Creates clone of source {@code MemberMap}, excluding given members.
If source is empty, same map instance will be returned. If excluded members are empty or not present in
source, a new map will be created containing the same members with source.

@param source         source map
@param excludeMembers members to exclude
@return clone map