MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / main

Method main

collectiontopics/TypesForSets.java:54–73  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

52 System.out.println(set);
53 }
54 public static void main(String[] args) {
55 test(new HashSet<>(), HashType::new);
56 test(new LinkedHashSet<>(), HashType::new);
57 test(new TreeSet<>(), TreeType::new);
58 // Things that don't work:
59 test(new HashSet<>(), SetType::new);
60 test(new HashSet<>(), TreeType::new);
61 test(new LinkedHashSet<>(), SetType::new);
62 test(new LinkedHashSet<>(), TreeType::new);
63 try {
64 test(new TreeSet<>(), SetType::new);
65 } catch(Exception e) {
66 System.out.println(e.getMessage());
67 }
68 try {
69 test(new TreeSet<>(), HashType::new);
70 } catch(Exception e) {
71 System.out.println(e.getMessage());
72 }
73 }
74}
75/* Output:
76[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

Callers

nothing calls this directly

Calls 2

testMethod · 0.95
getMessageMethod · 0.80

Tested by

no test coverage detected