updated source samples to use Java 8 lambdas