package com.kwangsu.lambdatest;

import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.Menu;
import android.view.MenuItem;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
//        fab.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View view) {
//                Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
//                        .setAction("Action", null).show();
//            }
//        });
        fab.setOnClickListener((view) -> {
            Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
                    .setAction("Action", null).show();
        });
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }
}

@@ -332,16 +332,94 @@
 uItem;%0A%0A
+import java.util.concurrent.Executor;%0Aimport java.util.concurrent.Executors;%0A%0A
 public c
@@ -813,18 +813,16 @@
 d.fab);%0A
-//
         
@@ -869,26 +869,24 @@
 istener() %7B%0A
-//
             
@@ -895,18 +895,16 @@
 verride%0A
-//
         
@@ -940,18 +940,16 @@
 view) %7B%0A
-//
         
@@ -1030,18 +1030,16 @@
 H_LONG)%0A
-//
         
@@ -1089,18 +1089,16 @@
 show();%0A
-//
         
@@ -1103,18 +1103,16 @@
       %7D%0A
-//
         
@@ -1111,24 +1111,26 @@
         %7D);%0A
+//
         fab.
@@ -1160,16 +1160,18 @@
 w) -%3E %7B%0A
+//
         
@@ -1240,32 +1240,34 @@
 ar.LENGTH_LONG)%0A
+//
                 
@@ -1297,32 +1297,302 @@
 , null).show();%0A
+//        %7D);%0A%0A        Executor executor = Executors.newSingleThreadExecutor();%0A        final Greeter greeter = new Greeter();%0A        executor.execute(new Runnable() %7B%0A            @Override%0A            public void run() %7B%0A                greeter.sayHi();%0A            %7D%0A
         %7D);%0A    
@@ -2322,10 +2322,108 @@
 ;%0A    %7D%0A
-%7D
 %0A
+    class Greeter %7B%0A        void sayHi() %7B%0A            System.out.println(%22Hi!%22);%0A        %7D%0A    %7D%0A%7D

add Runnable