Will take a copy of a non null set but doing so by replacing the internal one in one go for consistency.
432363
public void setCurrenciesSubjectToCrossCcyForT1(final Map<String, Set<String>> currenciesSubjectToCrossCcyForT1) {
        final Map<String, Set<String>> copy = new HashMap<>();
        if (currenciesSubjectToCrossCcyForT1 != null) {
            copy.putAll(currenciesSubjectToCrossCcyForT1);
        }
        this.currenciesSubjectToCrossCcyForT1 = copy;
    }
664657
public ChangeSet changeSet(String name, String reference) {
        return changeSet(name, reference, null);
    }
488951
public static <T> Set<T> nullToEmpty(final Set<T> set) {
        return set == null ? N.<T> emptySet() : set;
    }
732934
public static void copy(Object object, Field field, Object clone, Field cloneField, boolean ignoreNonExisting)
	{
		invokeSetter(clone, cloneField, invokeGetter(object, field), ignoreNonExisting);
	}
1087093
void copyValue(MutableBigInteger src) {
        int len = src.intLen;
        if (value.length < len)
            value = new int[len];
        System.arraycopy(src.value, src.offset, value, 0, len);
        intLen = len;
        offset = 0;
    }
271517
public void copy(Program that) {
      operatorSet.copy(that.operatorSet);
      variableSet.copy(that.variableSet);
      constantSet.copy(that.constantSet);
      depth = that.depth;
      length = that.length;

      if(that.root != null) {
         root = that.root.makeCopy(operatorSet, variableSet, constantSet);
      } else {
         root = null;
      }
   }
906408
def copy(self):
        """"""
        return self.__class__(self._key, self._load, self._iteritems())
1290336
private static <K, V> void makeSetsImmutable(Map<K, Set<V>> map) {
    Set<K> keys = map.keySet();
    for (K key : keys) {
      Set<V> value = map.get(key);
      map.put(key, Collections.unmodifiableSet(value));
    }
  }
654435
function copyIfSet(src, dest, prop) {
	if (src[prop]) {
		dest[prop] = src[prop];
	}
}
840642
private Snak copy(Snak snak) {
		if (snak instanceof ValueSnak) {
			return copy((ValueSnak) snak);
		} else if (snak instanceof NoValueSnak) {
			return copy((NoValueSnak) snak);
		} else if (snak instanceof SomeValueSnak) {
			return copy((SomeValueSnak) snak);
		} else {
			throw new IllegalArgumentException(
					"I don't know how to copy snaks of type " + snak.getClass());
		}
	}
1125874
def copy(self, overrides=None, locked=False):
        """"""
        other = copy.copy(self)

        if overrides is not None:
            other.overrides = overrides

        other.locked = locked

        other._uncache()
        return other
898332
@Inline(value="$2.$3copyOf($1)", imported=ImmutableSet.class)
	public static <T> Set<T> immutableCopy(Set<? extends T> set) {
		return ImmutableSet.copyOf(set);
	}
808436
public static <T> SortedSet<T> nullToEmpty(final SortedSet<T> set) {
        return set == null ? N.<T> emptySortedSet() : set;
    }
534139
@SuppressWarnings("unchecked")
    @NonNull
    public static Set<String> nonNullSet(@Nullable Collection<String> collection) {
        return collection == null || collection.isEmpty()
                ? Collections.<String>emptySet()
                : new HashSet<String>(collection);
    }
1344177
private Set<OrderBy> copyOrderingSet() {
    Set<OrderBy> orderingCopy = Sets.newLinkedHashSet();
    for (OrderBy order : this.ordering) {
      OrderBy copyOrder = new OrderBy();
      copyOrder.setField(order.getField());
      copyOrder.setSortOrder(order.getSortOrder());
      orderingCopy.add(copyOrder);
    }
    return orderingCopy;
  }
395876
public void copyFrom(LockSet other) {
        if (other.array.length != array.length) {
            array = new int[other.array.length];
        }
        System.arraycopy(other.array, 0, array, 0, array.length);
        this.defaultLockCount = other.defaultLockCount;
    }
50048
private static <K, V> Set<K> synchronizedCopyKeys(Map<K, V> map) {

        if (map == null) {
            return new HashSet<K>();
        }
        synchronized (map) {
            return new HashSet<K>(map.keySet());
        }
    }