Ray Milkey

Change Optional.ofNullable calls to Optional.of

Nullable check is not needed because argument is known to be non null

Change-Id: Ie3574ad9bbd1eff8a2088ac8da2804ea2f5e90a1
......@@ -48,9 +48,9 @@ public class MplsPathIntentInstallerTest extends IntentInstallerTest {
MplsPathIntentInstaller installer;
private final Optional<MplsLabel> ingressLabel =
Optional.ofNullable(MplsLabel.mplsLabel(10));
Optional.of(MplsLabel.mplsLabel(10));
private final Optional<MplsLabel> egressLabel =
Optional.ofNullable(MplsLabel.mplsLabel(20));
Optional.of(MplsLabel.mplsLabel(20));
private final List<Link> links = Arrays.asList(
new DefaultLink(PID, d1p1, d2p0, DIRECT),
......
......@@ -80,8 +80,8 @@ public class MplsIntentCompilerTest extends AbstractIntentTest {
*/
@Test
public void testForwardPathCompilation() {
Optional<MplsLabel> ingressLabel = Optional.ofNullable(MplsLabel.mplsLabel(10));
Optional<MplsLabel> egressLabel = Optional.ofNullable(MplsLabel.mplsLabel(20));
Optional<MplsLabel> ingressLabel = Optional.of(MplsLabel.mplsLabel(10));
Optional<MplsLabel> egressLabel = Optional.of(MplsLabel.mplsLabel(20));
MplsIntent intent = makeIntent("d1", ingressLabel, "d8", egressLabel);
assertThat(intent, is(notNullValue()));
......@@ -117,8 +117,8 @@ public class MplsIntentCompilerTest extends AbstractIntentTest {
*/
@Test
public void testReversePathCompilation() {
Optional<MplsLabel> ingressLabel = Optional.ofNullable(MplsLabel.mplsLabel(10));
Optional<MplsLabel> egressLabel = Optional.ofNullable(MplsLabel.mplsLabel(20));
Optional<MplsLabel> ingressLabel = Optional.of(MplsLabel.mplsLabel(10));
Optional<MplsLabel> egressLabel = Optional.of(MplsLabel.mplsLabel(20));
MplsIntent intent = makeIntent("d8", ingressLabel, "d1", egressLabel);
assertThat(intent, is(notNullValue()));
......