Comparing triangles using Java 8 streams I'm trying to get more familiar with Java 8 streams as they seem to be very powerful (and shorter), so I rewrote a method to use streams. However I'm not very satisfied with it and would like some suggestions on how to make better use of streams. The code itself has multiple nested loops, so it's not very easy. Also I'm forced to use final arrays to write the variables inside the lambda loops. 

// t1, t2 are List&lt;Triangle&gt; passed as parameter
Triangle original = t1.get(0);
t2.forEach(transformed -&gt; 
{

    for (int[] permutation : permutations)
    {
        Matrix trial = calculateMatrix(original.getVertices(), applyPermutation(transformed.getVertices(), permutation));

        final double[] sum = {0};
        points1.stream().map(v -&gt; v.extend(1)).map(trial::multiply).forEach(v -&gt; sum[0] += points2.stream().mapToDouble(v2 -&gt; distanceCheated(v, v2)).min().orElse(0));

        if (bestDeviation[0] == null || sum[0] &lt; bestDeviation[0])
        {
            second[0] = transformed;
            bestDeviation[0] = sum[0];
            bestMatrix[0] = trial;
        }
    }
});


EDIT: So as I aparently left out many important information, i try to provide them here:

The first obvious missing information is the connection between points1/2 and t1/2. points1/2 are plain two lists of points contained in two images (original and transformed). t1/2 are lists of triangles built with delauney triangulation using the points from points1/2. The goal is to calculate the transformation matrix used, to create the second set of points.

I posted the whole class here: https://gist.github.com/anonymous/8f21597d8a51c8960de7
Vertex is used as a Vector (mathematical)
Triangle consists of 3 Vertices
Since (as mentioned in my comment) the question is very tightly scoped, this review will be mostly style-focused:
Names
Some of your names are good. Some of your names are bad. I didn't see anything really ugly though, so you got that going for you ;)
Some examples of the good names include:

original, permutation, bestDeviation, trial


These names are speaking for themselves, it's almost instantly clear what they  mean.
On the other hand there's things like:

t1, t2, v, v2


These names are completely meaningless. I can't tell what they stand for, I have no idea (not in the slightest) what is in the variables with these names. It would tremendously help to understand your code's purpose, if I (or Mr. Maintainer) knew what the smallest units the code works with are.
I'd guesstimate you're operating on Vectors in a graphical representation of bodies, but I simply cannot be sure.
Anyways, from naming to:
Spacing and Linebreaks:
Thge code could use some additional linebreaks here and there, if only just to reduce the &quot;verical complexity&quot; of your code.
Normally I try to portion my code so you can read it one line at a time, and almost instantly understand what happens on it.
That's extremely hard when I need to scroll and there's multiple (low-level) transformations and operations. Try to write code, which doesn't take long to skim over and get the gist of.

points1.stream().map(v -&gt; v.extend(1)).map(trial::multiply).forEach(v -&gt; sum[0] += points2.stream().mapToDouble(v2 -&gt; distanceCheated(v, v2)).min().orElse(0));


then becomes:
points1.stream().map(v -&gt; v.extend(1))
        .map(trial::multiply)
        .forEach(v -&gt; sum[0] += points2.stream()
                .mapToDouble(v2 -&gt; distanceCheated(v, v2))
                .min().orElse(0)
        );

On the other hand there's one place where I feel you left too much space:

t2.forEach(transformed -&gt;
{

    for (int[] permutation : permutations) {


I'd write it like this:
t2.forEach(transformed -&gt; {
    for (int[] permutation : permutations) {

Other than this, there's no stylistic points to make here, and as mentioned I don't want to review the functionality without more information and context.