Skip to content

Commit

Permalink
use collect method instead to support java 8
Browse files Browse the repository at this point in the history
  • Loading branch information
miguel-vila authored and mtdowling committed Apr 5, 2023
1 parent 31de1ee commit f6396e7
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
import java.util.Map;
import java.util.Optional;
import java.util.function.Supplier;
import java.util.stream.Collectors;

import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Assumptions;
Expand Down Expand Up @@ -405,8 +407,8 @@ public void metadataIsNotAffectedByTheSourceName() {
.addUnparsedModel("b3.smithy", "metadata items = [3]")
.assemble()
.unwrap();
List<Number> metadata1 = model1.getMetadata().get("items").expectArrayNode().getElements().stream().map(s -> s.expectNumberNode().getValue()).toList();
List<Number> metadata2 = model2.getMetadata().get("items").expectArrayNode().getElements().stream().map(s -> s.expectNumberNode().getValue()).toList();
List<Number> metadata1 = model1.getMetadata().get("items").expectArrayNode().getElements().stream().map(s -> s.expectNumberNode().getValue()).collect(Collectors.toList());
List<Number> metadata2 = model2.getMetadata().get("items").expectArrayNode().getElements().stream().map(s -> s.expectNumberNode().getValue()).collect(Collectors.toList());
assertThat(metadata1, is(metadata2));
}

Expand Down

0 comments on commit f6396e7

Please sign in to comment.