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

Method main

patterns/trash/TrashVisitor.java:56–65  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

54
55public class TrashVisitor {
56 public static void main(String[] args) {
57 List<Trash> bin = new ArrayList<>();
58 ParseTrash.fillBin("trash", bin);
59 List<Visitor> visitors = Arrays.asList(
60 new PriceVisitor(), new WeightVisitor());
61 bin.forEach(
62 trash -> visitors.forEach(trash::accept)
63 );
64 visitors.forEach(Visitor::total);
65 }
66}
67/* Output:
68Loading patterns.trash.Cardboard

Callers

nothing calls this directly

Calls 1

fillBinMethod · 0.95

Tested by

no test coverage detected