Display a pattern

The problem

Write a program that displays the following pattern:

       J    A  V     V  A
       J   A A  V   V  A A
    J  J  AAAAA  V V  AAAAA
     JJ  A     A  V  A     A

Breaking it down

Initializing a List of strings with a diamond operator whiling adding each element will allow us to convert an arraylist to a stream. Next using a Stream.forEach while passing a method reference will println java 8 stream elements.

public static void main(String[] args) {

    List<String> patterns = new ArrayList<>();
    patterns.add("   J    A  V     V  A");
    patterns.add("   J   A A  V   V  A A");
    patterns.add("J  J  AAAAA  V V  AAAAA");
    patterns.add(" JJ  A     A  V  A     A");

    patterns.stream().forEach(System.out::println);

}

Output

   J    A  V     V  A
   J   A A  V   V  A A
J  J  AAAAA  V V  AAAAA
 JJ  A     A  V  A     A