LogicalClassifierDataGetter { public static DpnIdType getDpnIdFromNodeName(String theNodeName) { return Optional.of(theNodeName) .map(nodeName -> nodeName.split(":")) .filter(splitNodeName -> splitNodeName.length == 2) .map(splitNodeName -> splitNodeName[1]) .map(BigInteger::new) .map(DpnIdType::new) .orElseThrow(IllegalArgumentException::new); } 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 getDpnIdFromNodeNamePositive() { DpnIdType theDpn = LogicalClassifierDataGetter.getDpnIdFromNodeName(FIRST_SF_NODE_NAME); Assert.assertEquals(new DpnIdType(new BigInteger(FIRST_SF_DPN_ID)), theDpn); }
@Test(expected = IllegalArgumentException.class) public void getDpnIdFromNodeNameNegative() { LogicalClassifierDataGetter.getDpnIdFromNodeName("openflow:blabla:321"); }