AclServiceOFFlowBuilder { public static Map<String,List<MatchInfoBase>> programOtherProtocolFlow(AceIp acl) { List<MatchInfoBase> flowMatches = new ArrayList<>(); flowMatches.addAll(addSrcIpMatches(acl)); flowMatches.addAll(addDstIpMatches(acl)); if (acl.getAceIpVersion() instanceof AceIpv4) { flowMatches.add(MatchEthernetType.IPV4); } else if (acl.getAceIpVersion() instanceof AceIpv6) { flowMatches.add(MatchEthernetType.IPV6); } flowMatches.add(new MatchIpProtocol(acl.getProtocol().toJava())); String flowId = "OTHER_PROTO" + acl.getProtocol(); Map<String,List<MatchInfoBase>> flowMatchesMap = new HashMap<>(); flowMatchesMap.put(flowId,flowMatches); return flowMatchesMap; } private  AclServiceOFFlowBuilder(); @Nullable static Map<String, List<MatchInfoBase>> programIpFlow(Matches matches); static Map<String,List<MatchInfoBase>> programEtherFlow(AceIp acl); static Map<String,List<MatchInfoBase>> programOtherProtocolFlow(AceIp acl); static Map<String,List<MatchInfoBase>> programIcmpFlow(AceIp acl); static Map<String,List<MatchInfoBase>> programTcpFlow(AceIp acl); static Map<String,List<MatchInfoBase>> programUdpFlow(AceIp acl); static List<MatchInfoBase> addSrcIpMatches(AceIp acl); static List<MatchInfoBase> addDstIpMatches(AceIp acl); static List<MatchInfoBase> addLPortTagMatches(int lportTag, int conntrackState, int conntrackMask,
            Class<? extends ServiceModeBase> serviceMode); static List<InstructionInfo> getDropInstructionInfo(); static List<InstructionInfo> getResubmitInstructionInfo(short tableId); static List<InstructionInfo> getGotoInstructionInfo(short gotoTableId); static Map<Integer,Integer> getLayer4MaskForRange(int portMin, int portMax);  }
@Test public void testprogramOtherProtocolFlow() { AceIpBuilder builder = AclServiceTestUtils.prepareAceIpBuilder("10.1.1.1/24", "20.1.1.1/24", null, null, (short) 1); Map<String, List<MatchInfoBase>> flowMatchesMap = AclServiceOFFlowBuilder.programOtherProtocolFlow(builder.build()); List<MatchInfoBase> flowMatches = flowMatchesMap.get("OTHER_PROTO" + "1"); AclServiceTestUtils.verifyGeneralFlows(flowMatches, "1", "10.1.1.1", "20.1.1.1", "24"); }