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

Method main

reflection/PetCounter4.java:9–17  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

7
8public class PetCounter4 {
9 public static void main(String[] args) {
10 TypeCounter counter = new TypeCounter(Pet.class);
11 new PetCreator().stream()
12 .limit(20)
13 .peek(counter::count)
14 .forEach(p -> System.out.print(
15 p.getClass().getSimpleName() + " "));
16 System.out.println("\n" + counter);
17 }
18}
19/* Output:
20Rat Manx Cymric Mutt Pug Cymric Pug Manx Cymric Rat

Callers

nothing calls this directly

Calls 3

peekMethod · 0.80
printMethod · 0.80
streamMethod · 0.45

Tested by

no test coverage detected