@Test public void testImmutability() { System.out.println("immutability"); final List<?> pks = instance.make(k0, k1, k2, k3, k4, k5, k6, k7, k8); isImmutable(pks::clear); // isImmutable(() -> pks.add("Olle")); // isImmutable(() -> pks.addAll(Arrays.asList("Olle", "Sven"))); isImmutable(() -> pks.remove("Olle")); isImmutable(() -> pks.remove(1)); isImmutable(() -> pks.removeAll(new ArrayList<>())); isImmutable(() -> pks.replaceAll(UnaryOperator.identity())); }
@Test public void testMake_6args() { System.out.println("make"); final List<Object> expResult = new ArrayList<>(); expResult.add(k0); expResult.add(k1); expResult.add(k2); expResult.add(k3); expResult.add(k4); expResult.add(k5); expResult.add(k6); expResult.add(k7); expResult.add(k8); final List<?> result = instance.make(k0, k1, k2, k3, k4, k5, k6, k7, k8); assertEquals(expResult, result); }
@Test public void testMake_5args() { System.out.println("make"); assertEquals(Arrays.asList(k0, k1, k2, k3, k4), instance.make(k0, k1, k2, k3, k4)); }
@Test public void testMake_GenericType_GenericType() { System.out.println("make"); assertEquals(Arrays.asList(k0, k1), instance.make(k0, k1)); }