@@ -0,0 +1,2199 @@
+/*%0A * Copyright 2017 %22Masahiko Sakamoto%22 %3Csakamoto.gsyc.3s@gmail.com%3E%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage javasnack.langspecs;%0A%0Aimport static org.testng.Assert.assertEquals;%0A%0Aimport java.util.function.BiFunction;%0Aimport java.util.function.Function;%0Aimport java.util.function.IntSupplier;%0A%0Aimport org.testng.annotations.Test;%0A%0A/**%0A * @see http://docs.oracle.com/javase/tutorial/java/javaOO/methodreferences.html%0A */%0Apublic class TestMethodRefDemo %7B%0A%0A    static class RefDemo %7B%0A        public static int STATIC_INT = 10;%0A        public int instanceInt = 20;%0A%0A        String name;%0A        int age;%0A%0A        public RefDemo(String name, int age) %7B%0A            this.name = name;%0A            this.age = age;%0A        %7D%0A%0A        public static int getStaticInt() %7B%0A            return STATIC_INT;%0A        %7D%0A%0A        public int getInstanceInt() %7B%0A            return this.instanceInt;%0A        %7D%0A%0A        public String whoAreYou() %7B%0A            return %22My name is %22 + this.name + %22, %22 + this.age + %22 years old.%22;%0A        %7D%0A    %7D%0A%0A    @Test%0A    public void basicMethodRef() throws Exception %7B%0A        BiFunction%3CString, Integer, RefDemo%3E bif1 = RefDemo::new;%0A        RefDemo rd1 = bif1.apply(%22Jon%22, 10);%0A        assertEquals(rd1.name, %22Jon%22);%0A        assertEquals(rd1.age, 10);%0A%0A        RefDemo.STATIC_INT = 100;%0A        rd1.instanceInt = 200;%0A        IntSupplier sup1 = RefDemo::getStaticInt;%0A        IntSupplier sup2 = rd1::getInstanceInt;%0A        assertEquals(sup1.getAsInt(), 100);%0A        assertEquals(sup2.getAsInt(), 200);%0A%0A        Function%3CRefDemo, String%3E greeting = RefDemo::whoAreYou;%0A        assertEquals(greeting.apply(rd1), %22My name is Jon, 10 years old.%22);%0A    %7D%0A%7D%0A

add basic method reference demo and test code.