import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.security.SecureRandom;

public class Examples
{
    public static void main(String [] args)
        throws Exception
    {
        // Try-with-resources
        try(BufferedReader br = new BufferedReader(new FileReader("resources/file.txt")))
        {
            System.out.println("This will work with any object implementing java.lang.AutoCloseable!");
            System.out.println("Read line: " + br.readLine());
        }

        // Switch string
        String foo = "foo";
        switch (foo)
        {
            case "bar": System.out.println("er.."); break;
            case "foo": System.out.println("Awesome!");break;
        }

        // Binary litereals
        int thisIsReallyAnInteger = 0b00111;
        long thisIsReallyALong = 0b1010000101000101101000010100010110100001010001011010000101000101L;
        System.out.println("Integer value: " + thisIsReallyAnInteger);
        System.out.println("Long value: " + thisIsReallyALong);

        // Numerical literal
        int one_million = 1_000_000;
        System.out.println("Dr. Evil demands " + one_million + " dollars!");

        // Multi-catch
        try
        {
            someMethod();
            // should throw exception before we hit here
        }
        catch(FirstException|SecondException exception)
        {
            System.out.println("I caught a : " + exception.getClass());
        }
    }

    public static class FirstException extends Exception {};
    public static class SecondException extends Exception {};

    public static void someMethod()
            throws FirstException, SecondException
    {
        SecureRandom random = new SecureRandom();
        random.setSeed(System.currentTimeMillis());
        if (random.nextBoolean())
        {
            throw new FirstException();
        }
        else
        {
            throw new SecondException();
        }
    }
}

@@ -151,16 +151,67 @@
 eRandom;
+%0Aimport java.util.List;%0Aimport java.util.ArrayList;
 %0A%0Apublic
@@ -1563,24 +1563,168 @@
 );%0A        %7D
+%0A%0A        // Diamond operator%0A        List%3CString%3E list = new ArrayList%3C%3E();%0A        list.add(%22A%22);%0A        System.out.println(%22List: %22 + list);
 %0A    %7D%0A%0A    

Add Diamond Operator example