リビジョン 853beea7
| learn/java/lambda/HelloLambda/nbproject/project.properties | ||
|---|---|---|
|
javac.target=1.8
|
||
|
javac.test.classpath=\
|
||
|
${javac.classpath}:\
|
||
|
${build.classes.dir}
|
||
|
${build.classes.dir}:\
|
||
|
${libs.junit_4.classpath}
|
||
|
javac.test.processorpath=\
|
||
|
${javac.test.classpath}
|
||
|
javadoc.additionalparam=
|
||
| learn/java/lambda/HelloLambda/src/hellolambda/Hello.java | ||
|---|---|---|
|
/*
|
||
|
* To change this license header, choose License Headers in Project Properties.
|
||
|
* To change this template file, choose Tools | Templates
|
||
|
* and open the template in the editor.
|
||
|
*/
|
||
|
|
||
|
package hellolambda;
|
||
|
|
||
|
import java.util.Arrays;
|
||
|
|
||
|
/**
|
||
|
*
|
||
|
* @author toru
|
||
|
*/
|
||
|
public interface Hello {
|
||
|
static void main(String... args) {
|
||
|
Arrays.stream(args).forEach(System.out::println);
|
||
|
}
|
||
|
}
|
||
| learn/java/lambda/HelloLambda/src/hellolambda/HelloImpl.java | ||
|---|---|---|
|
/*
|
||
|
* To change this license header, choose License Headers in Project Properties.
|
||
|
* To change this template file, choose Tools | Templates
|
||
|
* and open the template in the editor.
|
||
|
*/
|
||
|
|
||
|
package hellolambda;
|
||
|
|
||
|
/**
|
||
|
*
|
||
|
* @author toru
|
||
|
*/
|
||
|
public class HelloImpl implements Hello {
|
||
|
|
||
|
}
|
||
| learn/java/lambda/HelloLambda/src/hellolambda/HelloLambda.java | ||
|---|---|---|
|
*/
|
||
|
public static void main(String[] args) {
|
||
|
Stream.of("Hello, ", "World").forEach(System.out::print);
|
||
|
Hello.main(args);
|
||
|
}
|
||
|
|
||
|
}
|
||
| learn/java/lambda/HelloLambda/test/hellolambda/HelloTest.java | ||
|---|---|---|
|
package hellolambda;
|
||
|
|
||
|
import org.junit.After;
|
||
|
import org.junit.AfterClass;
|
||
|
import org.junit.Before;
|
||
|
import org.junit.BeforeClass;
|
||
|
import org.junit.Test;
|
||
|
import static org.junit.Assert.*;
|
||
|
|
||
|
/**
|
||
|
*
|
||
|
* @author toru
|
||
|
*/
|
||
|
public class HelloTest {
|
||
|
|
||
|
public HelloTest() {
|
||
|
}
|
||
|
|
||
|
@BeforeClass
|
||
|
public static void setUpClass() {
|
||
|
}
|
||
|
|
||
|
@AfterClass
|
||
|
public static void tearDownClass() {
|
||
|
}
|
||
|
|
||
|
@Before
|
||
|
public void setUp() {
|
||
|
}
|
||
|
|
||
|
@After
|
||
|
public void tearDown() {
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Test of main method, of class Hello.
|
||
|
*/
|
||
|
@Test
|
||
|
public void testMain() {
|
||
|
String[] args = { "alfa", "bravo", "charlie" };
|
||
|
Hello.main(args);
|
||
|
}
|
||
|
|
||
|
}
|
||
Java SE 8のinterfaceのstaticメソッド実装とそれをテストするコードを作成