LogicalClassifierDataGetter { public Optional<DpnIdType> getFirstHopDataplaneId(RenderedServicePath theRsp) { return Optional.ofNullable(theRsp.getRenderedServicePathHop().get(0)) .map(this::getHopDataplaneId) .orElse(Optional.empty()); } private  LogicalClassifierDataGetter();  LogicalClassifierDataGetter(SfcGeniusRpcClient theRpcClient); Optional<String> getInterfaceBetweenDpnIds(DpnIdType srcDpnId, DpnIdType dstDpnId); List<Action> getEgressActionsForTunnelInterface(String theTunnelInterface, int actionOffset); Optional<String> getNodeName(String theInterfaceName); Optional<DpnIdType> getFirstHopDataplaneId(RenderedServicePath theRsp); Optional<DpnIdType> getHopDataplaneId(RenderedServicePathHop hopData); static Optional<Long> getOpenflowPort(String theInterfaceName); static DpnIdType getDpnIdFromNodeName(String theNodeName);  }
@Test public void testFetchingFirstHopDataplaneId() { Assert.assertEquals( FIRST_SF_DPN_ID, dataGetter.getFirstHopDataplaneId(rsp).get().getValue().toString()); }
@Test public void testFetchingFirstHopDataplaneIdInvalidAugmentation() { when(hop.getAugmentation(any())).thenReturn(null); Assert.assertFalse(dataGetter.getFirstHopDataplaneId(rsp).isPresent()); }