code: public static <E> Collection<E> sampleWithoutReplacement(Collection<E> c, int n, Random r) {
      if (n < 0)
        throw new IllegalArgumentException("n < 0: " + n);
      if (n > c.size())
        throw new IllegalArgumentException("n > size of collection: " + n + ", " + c.size());
      List<E> copy = new ArrayList<E>(c.size());
      copy.addAll(c);
      Collection<E> result = new ArrayList<E>(n);
      for (int k = 0; k < n; k++) {
        double d = r.nextDouble();
        int x = (int) (d * copy.size());
        result.add(copy.remove(x));
      }
      return result;
    }
docs: Samples without replacement from a collection, using your own
  {@link Random} number generator.
  
  @param c
  The collection to be sampled from
  @param n
  The number of samples to take
  @param r
  the random number generator
  @return a new collection with the sample