SlideShare a Scribd company logo
Java 8 Feature Preview
Mostly about Lambdas
New Feature Overview
• Roughly 50 new features
• Worth mentioning
– Concurrency updates (possible STM support)
– JDBC 4.2 – leverage new data types via generic
getter / setter methods (e.g. JSR 310 datatypes)
– Launch JavaFX apps directly
– http://openjdk.java.net/projects/jdk8/features
has full details
Forward Looking Statement
Download JDK 8
• Lambda Support
http://jdk8.java.net/lambda
• No Lambda Support
http://jdk8.java.net/download.html
IDE Support
• Netbeans
• IntelliJ
• Eclipse is on the way (own compiler)
Maven Support
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
Before Compact Profiles
(from Leader Summit –see http://www.hjug.org/present/iouc2013/2013-Java-Leaders-Summit-JavaSE.pdf)
Compact Profiles(from Leader Summit –see http://www.hjug.org/present/iouc2013/2013-Java-Leaders-Summit-JavaSE.pdf)
Nashorn
• Replacement for Rhino JavaScript Engine
• Collaboration between Oracle, IBM, and RedHat
• Makes extensive use of invokedynamic
• 20x faster than Rhino
• Much smaller - can run on embedded devices
• Open Sourced
• Project Page:
http://openjdk.java.net/projects/nashorn/
Metaspace
• Bye bye PermGen
• Holds class metadata
• Introduced for convergence with JRockit
• MetaSpace OoMEs can happen (when capped)
• Initial size limited by amt of native memory
• May want to update tuning flags
JSR 310 – java.time
• All the Java Time classes are immutable and
thread-safe.
• Based on the ISO 8601 calendar system, the de
facto world calendar following the proleptic
Gregorian Rules.
• Support for other calendar systems provided
in java.time.calendar and java.time.temporal
packages.
• Besides classes for dates and times, the API also
has classes for clocks, periods and durations, and
enums for month and day-of-week.
Lambdas
Lambdas
• A lambda expression is like a method: it
provides a list of formal parameters and a
body—an expression or block—expressed in
terms of those parameters.
• Expressions:
s -> s.length()
(int x, int y) -> x+y
() -> 42
Lambdas
• Blocks:
(x, y, z) -> {
if (true) return x;
else {
int result = y;
for (int i = 1; i < z; i++)
result *= i;
return result;
}
}
Typical Use Cases
• Anonymous classes (GUI listeners)
• Runnables / Callables
• Comparator
• Apply operation to a collection via foreach
method
SAM Type / Functional Interface
• Single Abstract Method
• A functional interface is an interface that has just
one abstract method, and thus represents a
single function contract. (Can have other
methods with bodies)
• Abstract classes may be considered in the future
• The @FunctionalInterface annotation helps
ensure the Functional Interface contract is
honored
• What happens when you have more than one
abstract method & use @FunctionalInterface?
Effectively Final
• For both lambda bodies and inner classes,
local variables in the enclosing context can
only be referenced if they
are final or effectively final.
• A variable is effectively final if its value is not
reassigned after its initialization.
• No longer need to litter code with final
keyword
Convert Anonymous Class to Lambdafrom http://learnjavafx.typepad.com/weblog/2013/02/mary-had-a-little-%CE%BB.html
// Anonymous inner class for event handling
.onAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent e) {
anim.playFromStart();
}
})
Convert Anonymous Class to Lambda
.onAction((ActionEvent) -> {
anim.playFromStart();
}
})
• The lambda type is inferred by the compiler
as EventHandler<ActionEvent> because
the onAction() method takes an object of
type EventHandler<ActionEvent>.
Convert Anonymous Class to Lambda
.onAction((e) -> {
anim.playFromStart();
})
• The parameter in this lambda expression must
be an ActionEvent, because that is the type
specified by the handle() method of
the EventHandler interface.
Convert Anonymous Class to Lambda
.onAction(e -> {
anim.playFromStart();
} )
• When a lambda expression has a single
parameter and its type is inferred, the
parentheses are not required
Convert Anonymous Class to Lambda
.onAction(e -> anim.playFromStart())
• Because the block of code in our lambda
expression contains only one statement, we
can simplify it even further
forEach
• forEach method available on Iterator & Map
interfaces and their implementations
• Allows for internal control of iteration of
elements for possible parallel operation
List<String> names =
Arrays.asList("Alice", "Bob", "Charlie");
names.forEach(e -> { System.out.println(e); });
java.util.stream
Classes to support functional-style operations on streams of values
• Stream<T> - A sequence of elements supporting
sequential and parallel bulk ops
• Stream opened by calling
– Collection.stream()
– Collection.parallelStream()
List<String> names =
Arrays.asList("Bob", "Alice", "Charlie");
out(names.stream().filter(e -> e.length() > 4 )
.findFirst().get());
Returns “Alice”
java.util.stream
• All other interfaces in stream package
accessible through Stream interface
• Collector<T,R> - A (possibly parallel) reduction
operation that folds input elements into a
mutable result container.
• FlatMapper<T,U> - An operation that maps an
element of type T to zero or more elements of
type U.
java.util.function
Functional interfaces provide target types for lambda expressions and method references.
• Consumer<T> - Action to be performed on an object.
• Function<T,R> - transform a T to an R.
• Supplier<T> - A supplier of objects (e.g. factory).
• Predicate<T> - Determines if the input object matches
some criteria.
• Unary/BinaryOperator<T> - An operation upon a single
/ two operand(s) yielding a result.
• Bi(Consumer/Function/Predicate)<T,U(,R)> - Accepts
two input arguments, yields result if specified
java.util
• Spliterator<T> - A provider of element
traversal operations for a possibly-parallel
computation.
• Optional<T> - A container object which may or
may not contain a non-null value
– Returned by Stream’s aggregate methods
find*(), reduce(), min(), max()
– Call get() to get the value it’s holding
Method & Constructor References
• A method reference is used to refer to a (static
or instance) method without invoking it
• A constructor reference is similarly used to
refer to a constructor without creating a new
instance of the named class or array type.
• Specified with the :: (double colon) operator
Method & Constructor References
• Provide a way to refer to a method / constructor
without invoking it
• Examples:
System::getProperty
"abc"::length
String::length
super::toString
ArrayList::new
int[]::new
Convert call to Method Reference
public class Test {
static void foo(){}
static {
new Runnable() {
@Override
public void run() {
Test.foo();
}
}.run();
}
}
Convert call to Method Reference
public class Test {
static void foo(){}
static {
((Runnable) () -> Test.foo()).run();
}
}
Convert call to Method Reference
public class Test {
static void foo(){}
static {
((Runnable) Test::foo()).run();
}
}
Use a Method Reference
This
bttnExit.setOnAction(
(actionEvent) -> {
try {
stop();
} catch (Exception e) {
// TODO: add error handling
} });
Can be
bttnExit.setOnAction(this::onExit
ButtonClick);
...
void onExitButtonClick() {
try {
stop();
} catch (Exception e) {
// TODO: add error handling
}
}
Use a Constructor Reference
interface Factory<T> { T make(); }
Factory<List<String>> f1 =
ArrayList::<String>new;
• Every time make() is invoked, it will return a
new ArrayList<String>
How many times have
you heard
Whatever!
• Method assigned to privileged interface:
public class Main {
public static class NotAutoCloseable {
public void close() throws Exception {
System.out.println("CLOSE");
}
}
public static void main(String... args) throws Exception {
NotAutoCloseable nac = new NotAutoCloseable();
try (AutoCloseable ac = nac::close) {
}
}
}
Interface Defender Methods
• Interface methods with bodies
• default keyword
• More graceful API evolution
• Interfaces have no state
• Static methods not inherited
• Can reference abstract method
• Called “Extended Interfaces” if no abstract
methods present
Super!
• Extended Interfaces can extend other extended
interfaces
• Methods can be overridden
• Can decorate parent definitions via super
interface I1 { default void method1() {//do stuff}}
interface I2 extends I1{
void default method1() {
super.method1();
//do new stuff
}
}
Specify the Parent Interface
interface D1 { default void meth1() {//do stuff}}
interface D2 extends D1{ void default meth1() {
super.method1(); //do new stuff}}
interface D3 extends D1{ void default meth1() {
super.method1(); //do new stuff}}
interface D4 extends D2, D3{
void default meth1() {
D2.super.method1(); //do new stuff}}
Design Patterns
• Decorator (via super)
• Template Method
• Factory Method
• Others?
New Java 8 Feature Overview
• http://openjdk.java.net/projects/jdk8/features
• http://java.dzone.com/articles/java-%E2%80%93-far-sight-look-jdk-8
Java 8 Maven Support
• http://illegalargumentexception.blogspot.com/2012/08/java-lambda-
support-in-java-8.html
DateTime API
• http://www.infoq.com/news/2013/02/java-time-api-jdk-8
• http://java.dzone.com/articles/introducing-new-date-and-time
• http://geekmonkey.org/articles/24-a-new-date-and-time-api-for-jdk-8
Metaspace
• http://java.dzone.com/articles/java-8-permgen-metaspace
Nashorn
• http://www.infoq.com/news/2012/11/Nashorn-proposal
Lambda JSR
• http://jcp.org/en/jsr/detail?id=335
Java 8 Preview JDK
• http://jdk8.java.net/lambda/ - lambda support
• http://jdk8.java.net/download.html - no lambda support
Articles on Lambdas
• http://www.oraclejavamagazine-digital.com/javamagazine/20121112?pg=35#pg35
• http://www.angelikalanger.com/Conferences/Slides/jf12_LambdasInJava8-1.pdf
• http://datumedge.blogspot.com/2012/06/java-8-lambdas.html
• http://www.infoq.com/articles/java-8-vs-scala
Presentations on Lambdas:
• http://www.slideshare.net/ramonypp/java-8-project-lambda
• http://www.slideshare.net/garthbrown/lambda-functions-in-java-8
• http://www.angelikalanger.com/Conferences/Slides/jf12_LambdasInJava8-1.pdf
Lambda implementation mechanics:
• http://cr.openjdk.java.net/~briangoetz/lambda/lambda-translation.html
Typical lambda use cases:
• http://learnjavafx.typepad.com/weblog/2013/02/mary-had-a-little-%CE%BB.html
• http://blueskyworkshop.com/topics/Java-Pages/lambda-expression-basics/
• http://java.dzone.com/articles/devoxx-2012-java-8-lambda-and
Defender method paper:
• http://cr.openjdk.java.net/~briangoetz/lambda/Defender%20Methods%20v4.pdf
Method references (:: operator)
• http://earthly-powers.blogspot.com/2012/07/java-8-lambda-and-method-references.html
• http://doanduyhai.wordpress.com/2012/07/14/java-8-lambda-in-details-part-iii-method-and-constructor-
referencing/
• http://www.beyondjava.net/blog/are-java-8-method-references-going-to-be-more-important-than-lambdas/
• http://www.lambdafaq.org/what-are-constructor-references/
Stream API:
• http://cr.openjdk.java.net/~briangoetz/lambda/sotc3.html
• http://aruld.info/java-8-this-aint-your-grandpas-java/
• http://java.dzone.com/articles/exciting-ideas-java-8-streams
Sophisticated Lambda use case allowing for avoiding NPEs using Monads:
• http://java.dzone.com/articles/no-more-excuses-use-null
Functional programming in Java
• http://code.google.com/p/functionaljava/
• http://shop.oreilly.com/product/0636920021667.do
• http://apocalisp.wordpress.com/2008/06/18/parallel-strategies-and-the-callable-monad/
Java 8 Feature Preview

More Related Content

What's hot

Java 8 Lambda and Streams
Java 8 Lambda and StreamsJava 8 Lambda and Streams
Java 8 Lambda and Streams
Venkata Naga Ravi
 
Productive Programming in Java 8 - with Lambdas and Streams
Productive Programming in Java 8 - with Lambdas and Streams Productive Programming in Java 8 - with Lambdas and Streams
Productive Programming in Java 8 - with Lambdas and Streams
Ganesh Samarthyam
 
Java 8 - Features Overview
Java 8 - Features OverviewJava 8 - Features Overview
Java 8 - Features Overview
Sergii Stets
 
Java 8 lambda
Java 8 lambdaJava 8 lambda
Java 8 lambda
Manav Prasad
 
Java SE 8 best practices
Java SE 8 best practicesJava SE 8 best practices
Java SE 8 best practices
Stephen Colebourne
 
Introduction to Java 8
Introduction to Java 8Introduction to Java 8
Introduction to Java 8
Knoldus Inc.
 
Java 8 features
Java 8 featuresJava 8 features
Java 8 features
Oleg Tsal-Tsalko
 
Introduction of Java 8 with emphasis on Lambda Expressions and Streams
Introduction of Java 8 with emphasis on Lambda Expressions and StreamsIntroduction of Java 8 with emphasis on Lambda Expressions and Streams
Introduction of Java 8 with emphasis on Lambda Expressions and Streams
Emiel Paasschens
 
Java 8: the good parts!
Java 8: the good parts!Java 8: the good parts!
Java 8: the good parts!
Andrzej Grzesik
 
Modern Programming in Java 8 - Lambdas, Streams and Date Time API
Modern Programming in Java 8 - Lambdas, Streams and Date Time APIModern Programming in Java 8 - Lambdas, Streams and Date Time API
Modern Programming in Java 8 - Lambdas, Streams and Date Time API
Ganesh Samarthyam
 
Java concurrency questions and answers
Java concurrency questions and answers Java concurrency questions and answers
Java concurrency questions and answers
CodeOps Technologies LLP
 
Streams in Java 8
Streams in Java 8Streams in Java 8
Streams in Java 8
Tobias Coetzee
 
The Dark Side Of Lambda Expressions in Java 8
The Dark Side Of Lambda Expressions in Java 8The Dark Side Of Lambda Expressions in Java 8
The Dark Side Of Lambda Expressions in Java 8
Takipi
 
Smart Migration to JDK 8
Smart Migration to JDK 8Smart Migration to JDK 8
Smart Migration to JDK 8
Geertjan Wielenga
 
Lambda Expressions in Java 8
Lambda Expressions in Java 8Lambda Expressions in Java 8
Lambda Expressions in Java 8
icarter09
 
Actors model in gpars
Actors model in gparsActors model in gpars
Actors model in gpars
NexThoughts Technologies
 
Introduction to new features in java 8
Introduction to new features in java 8Introduction to new features in java 8
New Features Of JDK 7
New Features Of JDK 7New Features Of JDK 7
New Features Of JDK 7
Deniz Oguz
 
Java 8 streams
Java 8 streamsJava 8 streams
Java 8 streams
Manav Prasad
 
Java SE 8 library design
Java SE 8 library designJava SE 8 library design
Java SE 8 library design
Stephen Colebourne
 

What's hot (20)

Java 8 Lambda and Streams
Java 8 Lambda and StreamsJava 8 Lambda and Streams
Java 8 Lambda and Streams
 
Productive Programming in Java 8 - with Lambdas and Streams
Productive Programming in Java 8 - with Lambdas and Streams Productive Programming in Java 8 - with Lambdas and Streams
Productive Programming in Java 8 - with Lambdas and Streams
 
Java 8 - Features Overview
Java 8 - Features OverviewJava 8 - Features Overview
Java 8 - Features Overview
 
Java 8 lambda
Java 8 lambdaJava 8 lambda
Java 8 lambda
 
Java SE 8 best practices
Java SE 8 best practicesJava SE 8 best practices
Java SE 8 best practices
 
Introduction to Java 8
Introduction to Java 8Introduction to Java 8
Introduction to Java 8
 
Java 8 features
Java 8 featuresJava 8 features
Java 8 features
 
Introduction of Java 8 with emphasis on Lambda Expressions and Streams
Introduction of Java 8 with emphasis on Lambda Expressions and StreamsIntroduction of Java 8 with emphasis on Lambda Expressions and Streams
Introduction of Java 8 with emphasis on Lambda Expressions and Streams
 
Java 8: the good parts!
Java 8: the good parts!Java 8: the good parts!
Java 8: the good parts!
 
Modern Programming in Java 8 - Lambdas, Streams and Date Time API
Modern Programming in Java 8 - Lambdas, Streams and Date Time APIModern Programming in Java 8 - Lambdas, Streams and Date Time API
Modern Programming in Java 8 - Lambdas, Streams and Date Time API
 
Java concurrency questions and answers
Java concurrency questions and answers Java concurrency questions and answers
Java concurrency questions and answers
 
Streams in Java 8
Streams in Java 8Streams in Java 8
Streams in Java 8
 
The Dark Side Of Lambda Expressions in Java 8
The Dark Side Of Lambda Expressions in Java 8The Dark Side Of Lambda Expressions in Java 8
The Dark Side Of Lambda Expressions in Java 8
 
Smart Migration to JDK 8
Smart Migration to JDK 8Smart Migration to JDK 8
Smart Migration to JDK 8
 
Lambda Expressions in Java 8
Lambda Expressions in Java 8Lambda Expressions in Java 8
Lambda Expressions in Java 8
 
Actors model in gpars
Actors model in gparsActors model in gpars
Actors model in gpars
 
Introduction to new features in java 8
Introduction to new features in java 8Introduction to new features in java 8
Introduction to new features in java 8
 
New Features Of JDK 7
New Features Of JDK 7New Features Of JDK 7
New Features Of JDK 7
 
Java 8 streams
Java 8 streamsJava 8 streams
Java 8 streams
 
Java SE 8 library design
Java SE 8 library designJava SE 8 library design
Java SE 8 library design
 

Similar to Java 8 Feature Preview

Lambdas and Laughs
Lambdas and LaughsLambdas and Laughs
Lambdas and Laughs
Jim Bethancourt
 
Java 8 new features
Java 8 new featuresJava 8 new features
Java 8 new features
Aniket Thakur
 
Java 8 - Project Lambda
Java 8 - Project LambdaJava 8 - Project Lambda
Java 8 - Project Lambda
Rahman USTA
 
Java 8 Intro - Core Features
Java 8 Intro - Core FeaturesJava 8 Intro - Core Features
Java 8 Intro - Core Features
GlobalLogic Ukraine
 
Automatic Migration of Legacy Java Method Implementations to Interfaces
Automatic Migration of Legacy Java Method Implementations to InterfacesAutomatic Migration of Legacy Java Method Implementations to Interfaces
Automatic Migration of Legacy Java Method Implementations to Interfaces
Raffi Khatchadourian
 
Lambda Chops - Recipes for Simpler, More Expressive Code
Lambda Chops - Recipes for Simpler, More Expressive CodeLambda Chops - Recipes for Simpler, More Expressive Code
Lambda Chops - Recipes for Simpler, More Expressive Code
Ian Robertson
 
java150929145120-lva1-app6892 (2).pptx
java150929145120-lva1-app6892 (2).pptxjava150929145120-lva1-app6892 (2).pptx
java150929145120-lva1-app6892 (2).pptx
BruceLee275640
 
Charles Sharp: Java 8 Streams
Charles Sharp: Java 8 StreamsCharles Sharp: Java 8 Streams
Charles Sharp: Java 8 Streams
jessitron
 
A Brief Conceptual Introduction to Functional Java 8 and its API
A Brief Conceptual Introduction to Functional Java 8 and its APIA Brief Conceptual Introduction to Functional Java 8 and its API
A Brief Conceptual Introduction to Functional Java 8 and its API
Jörn Guy Süß JGS
 
Belfast JUG 23-10-2013
Belfast JUG 23-10-2013Belfast JUG 23-10-2013
Belfast JUG 23-10-2013
eamonnlong
 
JDK8 Lambdas and Streams: Changing The Way You Think When Developing Java
JDK8 Lambdas and Streams: Changing The Way You Think When Developing JavaJDK8 Lambdas and Streams: Changing The Way You Think When Developing Java
JDK8 Lambdas and Streams: Changing The Way You Think When Developing Java
Simon Ritter
 
What's new in c# 8.0
What's new in c# 8.0What's new in c# 8.0
What's new in c# 8.0
Moaid Hathot
 
Java 8 Workshop
Java 8 WorkshopJava 8 Workshop
Java 8 Workshop
Mario Fusco
 
Java 8 Lambda Built-in Functional Interfaces
Java 8 Lambda Built-in Functional InterfacesJava 8 Lambda Built-in Functional Interfaces
Java 8 Lambda Built-in Functional Interfaces
Ganesh Samarthyam
 
Lambdas and Streams in Java SE 8: Making Bulk Operations simple - Simon Ritter
Lambdas and Streams in Java SE 8: Making Bulk Operations simple - Simon RitterLambdas and Streams in Java SE 8: Making Bulk Operations simple - Simon Ritter
Lambdas and Streams in Java SE 8: Making Bulk Operations simple - Simon Ritter
JAXLondon2014
 
Lambdas And Streams in JDK8
Lambdas And Streams in JDK8Lambdas And Streams in JDK8
Lambdas And Streams in JDK8
Simon Ritter
 
Lambdas : Beyond The Basics
Lambdas : Beyond The BasicsLambdas : Beyond The Basics
Lambdas : Beyond The Basics
Simon Ritter
 
Wien15 java8
Wien15 java8Wien15 java8
Wien15 java8
Jaanus Pöial
 
documents.pub_new-features-in-java-8-it-jpoialjavanaitedwien15java8pdf-java-8...
documents.pub_new-features-in-java-8-it-jpoialjavanaitedwien15java8pdf-java-8...documents.pub_new-features-in-java-8-it-jpoialjavanaitedwien15java8pdf-java-8...
documents.pub_new-features-in-java-8-it-jpoialjavanaitedwien15java8pdf-java-8...
Akaks
 

Similar to Java 8 Feature Preview (20)

Lambdas and Laughs
Lambdas and LaughsLambdas and Laughs
Lambdas and Laughs
 
Java 8 new features
Java 8 new featuresJava 8 new features
Java 8 new features
 
Java 8 - Project Lambda
Java 8 - Project LambdaJava 8 - Project Lambda
Java 8 - Project Lambda
 
Java 8 Intro - Core Features
Java 8 Intro - Core FeaturesJava 8 Intro - Core Features
Java 8 Intro - Core Features
 
Automatic Migration of Legacy Java Method Implementations to Interfaces
Automatic Migration of Legacy Java Method Implementations to InterfacesAutomatic Migration of Legacy Java Method Implementations to Interfaces
Automatic Migration of Legacy Java Method Implementations to Interfaces
 
Lambda Chops - Recipes for Simpler, More Expressive Code
Lambda Chops - Recipes for Simpler, More Expressive CodeLambda Chops - Recipes for Simpler, More Expressive Code
Lambda Chops - Recipes for Simpler, More Expressive Code
 
java150929145120-lva1-app6892 (2).pptx
java150929145120-lva1-app6892 (2).pptxjava150929145120-lva1-app6892 (2).pptx
java150929145120-lva1-app6892 (2).pptx
 
Charles Sharp: Java 8 Streams
Charles Sharp: Java 8 StreamsCharles Sharp: Java 8 Streams
Charles Sharp: Java 8 Streams
 
A Brief Conceptual Introduction to Functional Java 8 and its API
A Brief Conceptual Introduction to Functional Java 8 and its APIA Brief Conceptual Introduction to Functional Java 8 and its API
A Brief Conceptual Introduction to Functional Java 8 and its API
 
Belfast JUG 23-10-2013
Belfast JUG 23-10-2013Belfast JUG 23-10-2013
Belfast JUG 23-10-2013
 
JDK8 Lambdas and Streams: Changing The Way You Think When Developing Java
JDK8 Lambdas and Streams: Changing The Way You Think When Developing JavaJDK8 Lambdas and Streams: Changing The Way You Think When Developing Java
JDK8 Lambdas and Streams: Changing The Way You Think When Developing Java
 
What's new in c# 8.0
What's new in c# 8.0What's new in c# 8.0
What's new in c# 8.0
 
Collections
CollectionsCollections
Collections
 
Java 8 Workshop
Java 8 WorkshopJava 8 Workshop
Java 8 Workshop
 
Java 8 Lambda Built-in Functional Interfaces
Java 8 Lambda Built-in Functional InterfacesJava 8 Lambda Built-in Functional Interfaces
Java 8 Lambda Built-in Functional Interfaces
 
Lambdas and Streams in Java SE 8: Making Bulk Operations simple - Simon Ritter
Lambdas and Streams in Java SE 8: Making Bulk Operations simple - Simon RitterLambdas and Streams in Java SE 8: Making Bulk Operations simple - Simon Ritter
Lambdas and Streams in Java SE 8: Making Bulk Operations simple - Simon Ritter
 
Lambdas And Streams in JDK8
Lambdas And Streams in JDK8Lambdas And Streams in JDK8
Lambdas And Streams in JDK8
 
Lambdas : Beyond The Basics
Lambdas : Beyond The BasicsLambdas : Beyond The Basics
Lambdas : Beyond The Basics
 
Wien15 java8
Wien15 java8Wien15 java8
Wien15 java8
 
documents.pub_new-features-in-java-8-it-jpoialjavanaitedwien15java8pdf-java-8...
documents.pub_new-features-in-java-8-it-jpoialjavanaitedwien15java8pdf-java-8...documents.pub_new-features-in-java-8-it-jpoialjavanaitedwien15java8pdf-java-8...
documents.pub_new-features-in-java-8-it-jpoialjavanaitedwien15java8pdf-java-8...
 

More from Jim Bethancourt

JavaOne 2011 Recap
JavaOne 2011 RecapJavaOne 2011 Recap
JavaOne 2011 Recap
Jim Bethancourt
 
Ready, Set, Refactor
Ready, Set, RefactorReady, Set, Refactor
Ready, Set, Refactor
Jim Bethancourt
 
Introduction to CDI
Introduction to CDIIntroduction to CDI
Introduction to CDI
Jim Bethancourt
 
Functional Programming in Java
Functional Programming in JavaFunctional Programming in Java
Functional Programming in Java
Jim Bethancourt
 
Young Java Champions
Young Java ChampionsYoung Java Champions
Young Java Champions
Jim Bethancourt
 
Migrating to Maven 2 Demystified
Migrating to Maven 2 DemystifiedMigrating to Maven 2 Demystified
Migrating to Maven 2 Demystified
Jim Bethancourt
 
User Group Leader Lunch
User Group Leader LunchUser Group Leader Lunch
User Group Leader Lunch
Jim Bethancourt
 
Hearthstone To The Limit
Hearthstone To The LimitHearthstone To The Limit
Hearthstone To The Limit
Jim Bethancourt
 
Recognize, assess, reduce, and manage technical debt
Recognize, assess, reduce, and manage technical debtRecognize, assess, reduce, and manage technical debt
Recognize, assess, reduce, and manage technical debt
Jim Bethancourt
 
Atlassian Bamboo Feature Overview
Atlassian Bamboo Feature OverviewAtlassian Bamboo Feature Overview
Atlassian Bamboo Feature Overview
Jim Bethancourt
 
Java Performance Tweaks
Java Performance TweaksJava Performance Tweaks
Java Performance Tweaks
Jim Bethancourt
 
Refactor to the Limit!
Refactor to the Limit!Refactor to the Limit!
Refactor to the Limit!
Jim Bethancourt
 

More from Jim Bethancourt (12)

JavaOne 2011 Recap
JavaOne 2011 RecapJavaOne 2011 Recap
JavaOne 2011 Recap
 
Ready, Set, Refactor
Ready, Set, RefactorReady, Set, Refactor
Ready, Set, Refactor
 
Introduction to CDI
Introduction to CDIIntroduction to CDI
Introduction to CDI
 
Functional Programming in Java
Functional Programming in JavaFunctional Programming in Java
Functional Programming in Java
 
Young Java Champions
Young Java ChampionsYoung Java Champions
Young Java Champions
 
Migrating to Maven 2 Demystified
Migrating to Maven 2 DemystifiedMigrating to Maven 2 Demystified
Migrating to Maven 2 Demystified
 
User Group Leader Lunch
User Group Leader LunchUser Group Leader Lunch
User Group Leader Lunch
 
Hearthstone To The Limit
Hearthstone To The LimitHearthstone To The Limit
Hearthstone To The Limit
 
Recognize, assess, reduce, and manage technical debt
Recognize, assess, reduce, and manage technical debtRecognize, assess, reduce, and manage technical debt
Recognize, assess, reduce, and manage technical debt
 
Atlassian Bamboo Feature Overview
Atlassian Bamboo Feature OverviewAtlassian Bamboo Feature Overview
Atlassian Bamboo Feature Overview
 
Java Performance Tweaks
Java Performance TweaksJava Performance Tweaks
Java Performance Tweaks
 
Refactor to the Limit!
Refactor to the Limit!Refactor to the Limit!
Refactor to the Limit!
 

Recently uploaded

TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
Tier1 app
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
IES VE
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
e20449
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
Srikant77
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 

Recently uploaded (20)

TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 

Java 8 Feature Preview

  • 1. Java 8 Feature Preview Mostly about Lambdas
  • 2. New Feature Overview • Roughly 50 new features • Worth mentioning – Concurrency updates (possible STM support) – JDBC 4.2 – leverage new data types via generic getter / setter methods (e.g. JSR 310 datatypes) – Launch JavaFX apps directly – http://openjdk.java.net/projects/jdk8/features has full details
  • 4. Download JDK 8 • Lambda Support http://jdk8.java.net/lambda • No Lambda Support http://jdk8.java.net/download.html
  • 5. IDE Support • Netbeans • IntelliJ • Eclipse is on the way (own compiler)
  • 7. Before Compact Profiles (from Leader Summit –see http://www.hjug.org/present/iouc2013/2013-Java-Leaders-Summit-JavaSE.pdf)
  • 8. Compact Profiles(from Leader Summit –see http://www.hjug.org/present/iouc2013/2013-Java-Leaders-Summit-JavaSE.pdf)
  • 9. Nashorn • Replacement for Rhino JavaScript Engine • Collaboration between Oracle, IBM, and RedHat • Makes extensive use of invokedynamic • 20x faster than Rhino • Much smaller - can run on embedded devices • Open Sourced • Project Page: http://openjdk.java.net/projects/nashorn/
  • 10. Metaspace • Bye bye PermGen • Holds class metadata • Introduced for convergence with JRockit • MetaSpace OoMEs can happen (when capped) • Initial size limited by amt of native memory • May want to update tuning flags
  • 11. JSR 310 – java.time • All the Java Time classes are immutable and thread-safe. • Based on the ISO 8601 calendar system, the de facto world calendar following the proleptic Gregorian Rules. • Support for other calendar systems provided in java.time.calendar and java.time.temporal packages. • Besides classes for dates and times, the API also has classes for clocks, periods and durations, and enums for month and day-of-week.
  • 13. Lambdas • A lambda expression is like a method: it provides a list of formal parameters and a body—an expression or block—expressed in terms of those parameters. • Expressions: s -> s.length() (int x, int y) -> x+y () -> 42
  • 14. Lambdas • Blocks: (x, y, z) -> { if (true) return x; else { int result = y; for (int i = 1; i < z; i++) result *= i; return result; } }
  • 15. Typical Use Cases • Anonymous classes (GUI listeners) • Runnables / Callables • Comparator • Apply operation to a collection via foreach method
  • 16. SAM Type / Functional Interface • Single Abstract Method • A functional interface is an interface that has just one abstract method, and thus represents a single function contract. (Can have other methods with bodies) • Abstract classes may be considered in the future • The @FunctionalInterface annotation helps ensure the Functional Interface contract is honored • What happens when you have more than one abstract method & use @FunctionalInterface?
  • 17.
  • 18. Effectively Final • For both lambda bodies and inner classes, local variables in the enclosing context can only be referenced if they are final or effectively final. • A variable is effectively final if its value is not reassigned after its initialization. • No longer need to litter code with final keyword
  • 19.
  • 20. Convert Anonymous Class to Lambdafrom http://learnjavafx.typepad.com/weblog/2013/02/mary-had-a-little-%CE%BB.html // Anonymous inner class for event handling .onAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { anim.playFromStart(); } })
  • 21. Convert Anonymous Class to Lambda .onAction((ActionEvent) -> { anim.playFromStart(); } }) • The lambda type is inferred by the compiler as EventHandler<ActionEvent> because the onAction() method takes an object of type EventHandler<ActionEvent>.
  • 22. Convert Anonymous Class to Lambda .onAction((e) -> { anim.playFromStart(); }) • The parameter in this lambda expression must be an ActionEvent, because that is the type specified by the handle() method of the EventHandler interface.
  • 23. Convert Anonymous Class to Lambda .onAction(e -> { anim.playFromStart(); } ) • When a lambda expression has a single parameter and its type is inferred, the parentheses are not required
  • 24. Convert Anonymous Class to Lambda .onAction(e -> anim.playFromStart()) • Because the block of code in our lambda expression contains only one statement, we can simplify it even further
  • 25.
  • 26. forEach • forEach method available on Iterator & Map interfaces and their implementations • Allows for internal control of iteration of elements for possible parallel operation List<String> names = Arrays.asList("Alice", "Bob", "Charlie"); names.forEach(e -> { System.out.println(e); });
  • 27. java.util.stream Classes to support functional-style operations on streams of values • Stream<T> - A sequence of elements supporting sequential and parallel bulk ops • Stream opened by calling – Collection.stream() – Collection.parallelStream() List<String> names = Arrays.asList("Bob", "Alice", "Charlie"); out(names.stream().filter(e -> e.length() > 4 ) .findFirst().get()); Returns “Alice”
  • 28. java.util.stream • All other interfaces in stream package accessible through Stream interface • Collector<T,R> - A (possibly parallel) reduction operation that folds input elements into a mutable result container. • FlatMapper<T,U> - An operation that maps an element of type T to zero or more elements of type U.
  • 29. java.util.function Functional interfaces provide target types for lambda expressions and method references. • Consumer<T> - Action to be performed on an object. • Function<T,R> - transform a T to an R. • Supplier<T> - A supplier of objects (e.g. factory). • Predicate<T> - Determines if the input object matches some criteria. • Unary/BinaryOperator<T> - An operation upon a single / two operand(s) yielding a result. • Bi(Consumer/Function/Predicate)<T,U(,R)> - Accepts two input arguments, yields result if specified
  • 30. java.util • Spliterator<T> - A provider of element traversal operations for a possibly-parallel computation. • Optional<T> - A container object which may or may not contain a non-null value – Returned by Stream’s aggregate methods find*(), reduce(), min(), max() – Call get() to get the value it’s holding
  • 31. Method & Constructor References • A method reference is used to refer to a (static or instance) method without invoking it • A constructor reference is similarly used to refer to a constructor without creating a new instance of the named class or array type. • Specified with the :: (double colon) operator
  • 32. Method & Constructor References • Provide a way to refer to a method / constructor without invoking it • Examples: System::getProperty "abc"::length String::length super::toString ArrayList::new int[]::new
  • 33.
  • 34. Convert call to Method Reference public class Test { static void foo(){} static { new Runnable() { @Override public void run() { Test.foo(); } }.run(); } }
  • 35. Convert call to Method Reference public class Test { static void foo(){} static { ((Runnable) () -> Test.foo()).run(); } }
  • 36. Convert call to Method Reference public class Test { static void foo(){} static { ((Runnable) Test::foo()).run(); } }
  • 37. Use a Method Reference This bttnExit.setOnAction( (actionEvent) -> { try { stop(); } catch (Exception e) { // TODO: add error handling } }); Can be bttnExit.setOnAction(this::onExit ButtonClick); ... void onExitButtonClick() { try { stop(); } catch (Exception e) { // TODO: add error handling } }
  • 38. Use a Constructor Reference interface Factory<T> { T make(); } Factory<List<String>> f1 = ArrayList::<String>new; • Every time make() is invoked, it will return a new ArrayList<String>
  • 39. How many times have you heard
  • 40.
  • 41. Whatever! • Method assigned to privileged interface: public class Main { public static class NotAutoCloseable { public void close() throws Exception { System.out.println("CLOSE"); } } public static void main(String... args) throws Exception { NotAutoCloseable nac = new NotAutoCloseable(); try (AutoCloseable ac = nac::close) { } } }
  • 42. Interface Defender Methods • Interface methods with bodies • default keyword • More graceful API evolution • Interfaces have no state • Static methods not inherited • Can reference abstract method • Called “Extended Interfaces” if no abstract methods present
  • 43.
  • 44. Super! • Extended Interfaces can extend other extended interfaces • Methods can be overridden • Can decorate parent definitions via super interface I1 { default void method1() {//do stuff}} interface I2 extends I1{ void default method1() { super.method1(); //do new stuff } }
  • 45.
  • 46. Specify the Parent Interface interface D1 { default void meth1() {//do stuff}} interface D2 extends D1{ void default meth1() { super.method1(); //do new stuff}} interface D3 extends D1{ void default meth1() { super.method1(); //do new stuff}} interface D4 extends D2, D3{ void default meth1() { D2.super.method1(); //do new stuff}}
  • 47. Design Patterns • Decorator (via super) • Template Method • Factory Method • Others?
  • 48. New Java 8 Feature Overview • http://openjdk.java.net/projects/jdk8/features • http://java.dzone.com/articles/java-%E2%80%93-far-sight-look-jdk-8 Java 8 Maven Support • http://illegalargumentexception.blogspot.com/2012/08/java-lambda- support-in-java-8.html DateTime API • http://www.infoq.com/news/2013/02/java-time-api-jdk-8 • http://java.dzone.com/articles/introducing-new-date-and-time • http://geekmonkey.org/articles/24-a-new-date-and-time-api-for-jdk-8 Metaspace • http://java.dzone.com/articles/java-8-permgen-metaspace Nashorn • http://www.infoq.com/news/2012/11/Nashorn-proposal
  • 49. Lambda JSR • http://jcp.org/en/jsr/detail?id=335 Java 8 Preview JDK • http://jdk8.java.net/lambda/ - lambda support • http://jdk8.java.net/download.html - no lambda support Articles on Lambdas • http://www.oraclejavamagazine-digital.com/javamagazine/20121112?pg=35#pg35 • http://www.angelikalanger.com/Conferences/Slides/jf12_LambdasInJava8-1.pdf • http://datumedge.blogspot.com/2012/06/java-8-lambdas.html • http://www.infoq.com/articles/java-8-vs-scala Presentations on Lambdas: • http://www.slideshare.net/ramonypp/java-8-project-lambda • http://www.slideshare.net/garthbrown/lambda-functions-in-java-8 • http://www.angelikalanger.com/Conferences/Slides/jf12_LambdasInJava8-1.pdf Lambda implementation mechanics: • http://cr.openjdk.java.net/~briangoetz/lambda/lambda-translation.html
  • 50. Typical lambda use cases: • http://learnjavafx.typepad.com/weblog/2013/02/mary-had-a-little-%CE%BB.html • http://blueskyworkshop.com/topics/Java-Pages/lambda-expression-basics/ • http://java.dzone.com/articles/devoxx-2012-java-8-lambda-and Defender method paper: • http://cr.openjdk.java.net/~briangoetz/lambda/Defender%20Methods%20v4.pdf Method references (:: operator) • http://earthly-powers.blogspot.com/2012/07/java-8-lambda-and-method-references.html • http://doanduyhai.wordpress.com/2012/07/14/java-8-lambda-in-details-part-iii-method-and-constructor- referencing/ • http://www.beyondjava.net/blog/are-java-8-method-references-going-to-be-more-important-than-lambdas/ • http://www.lambdafaq.org/what-are-constructor-references/ Stream API: • http://cr.openjdk.java.net/~briangoetz/lambda/sotc3.html • http://aruld.info/java-8-this-aint-your-grandpas-java/ • http://java.dzone.com/articles/exciting-ideas-java-8-streams Sophisticated Lambda use case allowing for avoiding NPEs using Monads: • http://java.dzone.com/articles/no-more-excuses-use-null Functional programming in Java • http://code.google.com/p/functionaljava/ • http://shop.oreilly.com/product/0636920021667.do • http://apocalisp.wordpress.com/2008/06/18/parallel-strategies-and-the-callable-monad/