Skip to content

Instantly share code, notes, and snippets.

@defndaines
Created June 4, 2016 01:45
Show Gist options
  • Select an option

  • Save defndaines/713258100efdb6617f538320212942ca to your computer and use it in GitHub Desktop.

Select an option

Save defndaines/713258100efdb6617f538320212942ca to your computer and use it in GitHub Desktop.
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
List<Double> doubles = Arrays.asList(3.0, 3.0, 3.0);
Optional<Double> pow = doubles.stream().reduce(Math::pow);
List<String> words = Arrays.asList("/a/", "b", "c");
Optional<String> result = words.stream().reduce(""::replaceFirst);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment