collection lambdas added

This commit is contained in:
Kroczek Christoph (TT-RHC/ESC6)
2019-07-15 10:56:22 +02:00
parent d8791e7fc8
commit ca8950238d
6 changed files with 96 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
import java.util.HashMap;
import java.util.Map;
/*
* This Java source file was generated by the Gradle 'init' task.
*/
public class App {
public static void main(String[] args) {
Map<String, Integer> testlist = new HashMap<String, Integer>();
testlist.put("one", 1);
testlist.put("two", 2);
testlist.put("three", 3);
testlist.forEach((k, v) -> System.out.println(k + ":" + v));
}
}

View File

@@ -0,0 +1,12 @@
/*
* This Java source file was generated by the Gradle 'init' task.
*/
import org.junit.Test;
import static org.junit.Assert.*;
public class AppTest {
@Test public void testAppHasAGreeting() {
App classUnderTest = new App();
assertNotNull("app should have a greeting", classUnderTest.getGreeting());
}
}