package jetbrains.mps.closures.test;

/*Generated by MPS */

import org.junit.jupiter.api.Test;
import java.util.List;
import java.util.Arrays;
import java.util.Optional;
import org.junit.Assert;

public class ClosuresStreamTest_Test {
  @Test
  public void test_arrayOfArray() throws Exception {
    List<List<Integer>> asList = Arrays.asList(Arrays.asList(1, 2, 3), Arrays.asList(4, 5, 6), Arrays.asList(7, 8, 9));

    Optional<String> result = asList.stream().parallel().flatMap((p1) -> p1.stream()).filter((p1) -> p1 > 4).map((p1) -> p1.toString()).distinct().sorted().skip(1).limit(2).reduce((a, b) -> a + "." + b);

    Assert.assertEquals("6.7", result.get());
  }
}
