package _4_wildcards;

import java.util.Arrays;
import java.util.List;

public class WildcardsExample
{

    private static final List<Message> messages = Arrays.asList(
        new EmailMessage("Hello by email"),
        new TextMessage("Hello by text")
    );

    private static final List<EmailMessage> emailMessages
        = Arrays.asList(new EmailMessage("Hello by email"));

    private static final List<TextMessage> textMessages
        = Arrays.asList(new TextMessage("Hello by text"));

    public static void main(String[] args)
    {
        // 0. log a message
        // 1. Lists aren't covariant
        // 2. Wildcards
        // 3. Consumer parameter
    }

    static void log(Message message)
    {
        System.out.println(message);
    }

    static void logAll(List<Message> messages)
    {
        for (Message message : messages)
        {
            System.out.println(message);
        }
    }

}

@@ -582,16 +582,66 @@
    // 1.
+ log arrays%0A        // 2. assignment%0A        // 3.
  Lists a
@@ -667,17 +667,17 @@
      // 
-2
+4
 . Wildca
@@ -691,17 +691,17 @@
      // 
-3
+5
 . Consum
@@ -799,32 +799,190 @@
 essage);%0A    %7D%0A%0A
+    static void logAll(Message%5B%5D messages)%0A    %7B%0A        for (Message message : messages)%0A        %7B%0A            System.out.println(message);%0A        %7D%0A    %7D%0A%0A
     static void 

add arrays in