Migrate tests away from Optional.get()
[bgpcep.git] / bgp / openconfig-rp-statement / src / test / java / org / opendaylight / protocol / bgp / openconfig / routing / policy / statement / MatchAfiSafiNotInTest.java
index eb1fa925a06df2b53e94294435232bc2f61c64be..47327cbef4967f61b4f153fd5dbd93a17c4dc712 100644 (file)
@@ -46,7 +46,7 @@ public class MatchAfiSafiNotInTest extends AbstractStatementRegistryConsumerTest
     @Test
     public void testExtComAny() {
         Statement statement = basicStatements.stream()
-                .filter(st -> st.getName().equals("match-afi-safi-not-in-test")).findFirst().get();
+                .filter(st -> st.getName().equals("match-afi-safi-not-in-test")).findFirst().orElseThrow();
         RouteAttributeContainer attributeContainer = routeAttributeContainerFalse(
                 new AttributesBuilder().build());
         RouteAttributeContainer result = statementRegistry.applyExportStatement(