@Test
public void testCopyOf() {

    LOG.info("testCopyOf");
    final Collection<Integer> x = Immutables.listOf(1);
    Assert.assertTrue("Array " + x + " should contain 1", x.contains(1));
    final Collection<Integer> x2 = Immutables.copyOf(x);
    Assert.assertTrue("Array " + x2 + " should equal ", x2.equals(x));
    final Collection<Integer> a = Immutables.copyOf(x, 2);
    Assert.assertTrue("Array " + a + " should contain 1", a.contains(1));
    Assert.assertTrue("Array " + a + " should contain 2", a.contains(2));
    @SuppressWarnings("unchecked")
    final Set<Integer> b = new LinkedHashSet<>();
    final Collection<Integer> b1 = Immutables.copyOf(b);
    Assert.assertTrue("Array " + b1 + " should be empty", b1.isEmpty());
    final Collection<Integer> c = Immutables.copyOf(a, 3, 4);
    final Collection<Integer> d = Immutables.copyOf(b, 1, 2, 3, 4);
    final Collection<Integer> e = Immutables.copyOf(b, 2, 1, 3, 4);
    Assert.assertTrue("Array " + c + " should equal " + d, d.equals(c));
    Assert.assertFalse("Array " + c + " should not equal " + e, e.equals(c));
    final Collection<Integer> u0 = Immutables.copyOf(Immutables.<Integer>emptyList());
    @SuppressWarnings("unchecked")
    final Collection<Integer> v0 = Immutables.copyOf(new ArrayList<>());
    Assert.assertTrue("Array " + u0 + " should equal " + v0, u0.equals(v0));
}