### Question:
DestinationMapperFlows { void dropFlow(int priority, Long etherType, OfWriter ofWriter) { FlowId flowId; FlowBuilder flowBuilder = FlowUtils.base(tableId) .setPriority(priority) .setInstructions(FlowUtils.dropInstructions()); if (etherType != null) { MatchBuilder matchBuilder = new MatchBuilder() .setEthernetMatch(FlowUtils.ethernetMatch(null, null, etherType)); Match match = matchBuilder.build(); flowId = FlowIdUtils.newFlowId(tableId, "drop", match); flowBuilder.setMatch(match); } else { flowId = FlowIdUtils.newFlowId("dropAll"); } flowBuilder.setId(flowId); ofWriter.writeFlow(nodeId, tableId, flowBuilder.build()); } DestinationMapperFlows(DestinationMapperUtils utils, NodeId nodeId, short tableId);   }### Answer:
@Test public void testDropFlow_noEthertype() { Flow testFlow = buildFlow(new FlowId(DROP_ALL), tableId, 100, null, FlowUtils.dropInstructions()).build(); flows.dropFlow(100, null, ofWriter); verify(ofWriter, times(1)).writeFlow(NODE_ID, tableId, testFlow); }
@Test public void testDropFlow_ipV4Ethertype() { MatchBuilder matchBuilder = new MatchBuilder(); matchBuilder.setEthernetMatch(FlowUtils.ethernetMatch(null, null, FlowUtils.IPv4)); Match match = matchBuilder.build(); Flow testFlow = buildFlow(FlowIdUtils.newFlowId(tableId, DROP, match), tableId, 100, match, FlowUtils.dropInstructions()).build(); flows.dropFlow(100, FlowUtils.IPv4, ofWriter); verify(ofWriter, times(1)).writeFlow(NODE_ID, tableId, testFlow); }
@Test public void testDropFlow_ipV6Ethertype() { MatchBuilder matchBuilder = new MatchBuilder(); matchBuilder.setEthernetMatch(FlowUtils.ethernetMatch(null, null, FlowUtils.IPv6)); Match match = matchBuilder.build(); Flow testFlow = buildFlow(FlowIdUtils.newFlowId(tableId, DROP, match), tableId, 100, match, FlowUtils.dropInstructions()).build(); flows.dropFlow(100, FlowUtils.IPv6, ofWriter); verify(ofWriter, times(1)).writeFlow(NODE_ID, tableId, testFlow); }
@Test public void testDropFlow_arpEthertype() { MatchBuilder matchBuilder = new MatchBuilder(); matchBuilder.setEthernetMatch(FlowUtils.ethernetMatch(null, null, FlowUtils.ARP)); Match match = matchBuilder.build(); Flow testFlow = buildFlow(FlowIdUtils.newFlowId(tableId, DROP, match), tableId, 100, match, FlowUtils.dropInstructions()).build(); flows.dropFlow(100, FlowUtils.ARP, ofWriter); verify(ofWriter, times(1)).writeFlow(NODE_ID, tableId, testFlow); }