Source:
<code>public void canParseNetflow5Flows() { List<Flow> flows = getFlowsForPayloadsInSession("/flows/netflow5.dat"); MatcherAssert.assertThat(flows, hasSize(2)); final Flow flow = flows.get(0); assertThat(flow.getNetflowVersion(), is((Flow.NetflowVersion.V5))); assertThat(flow.getFlowRecords(), is(2)); assertThat(flow.getFlowSeqNum(), is(0L)); assertThat(flow.getEngineId(), is(0)); assertThat(flow.getEngineType(), is(0)); assertThat(flow.getSamplingInterval(), is(0.0)); assertThat(flow.getSamplingAlgorithm(), is(Flow.SamplingAlgorithm.Unassigned)); MatcherAssert.assertThat(flow.getSrcAddr(), equalTo("10.0.2.2")); MatcherAssert.assertThat(flow.getSrcAddrHostname(), equalTo(Optional.of(""))); MatcherAssert.assertThat(flow.getSrcPort(), equalTo(54435)); MatcherAssert.assertThat(flow.getSrcMaskLen(), equalTo(0)); MatcherAssert.assertThat(flow.getDstAddr(), equalTo("10.0.2.15")); <START> MatcherAssert.assertThat(flow.getDstAddrHostname(), equalTo(Optional.of(""))); <END> MatcherAssert.assertThat(flow.getDstPort(), equalTo(22)); MatcherAssert.assertThat(flow.getDstMaskLen(), equalTo(0)); MatcherAssert.assertThat(flow.getTcpFlags(), equalTo(16)); MatcherAssert.assertThat(flow.getProtocol(), equalTo(6)); MatcherAssert.assertThat(flow.getBytes(), equalTo(230L)); MatcherAssert.assertThat(flow.getInputSnmp(), equalTo(0)); MatcherAssert.assertThat(flow.getOutputSnmp(), equalTo(0)); MatcherAssert.assertThat(flow.getFirstSwitched(), equalTo(1434886852194L)); MatcherAssert.assertThat(flow.getLastSwitched(), equalTo(1430591887476L)); MatcherAssert.assertThat(flow.getPackets(), equalTo(5L)); MatcherAssert.assertThat(flow.getDirection(), equalTo(Flow.Direction.INGRESS)); MatcherAssert.assertThat(flow.getNextHop(), equalTo("0.0.0.0")); MatcherAssert.assertThat(flow.getNextHopHostname(), equalTo(Optional.of(""))); MatcherAssert.assertThat(flow.getVlan(), equalTo(0)); }</code><technical_language>if "" is semantically equal null in this case</technical_language>

Target:
public void canParseNetflow5Flows() { List<Flow> flows = getFlowsForPayloadsInSession("/flows/netflow5.dat"); MatcherAssert.assertThat(flows, hasSize(2)); final Flow flow = flows.get(0); assertThat(flow.getNetflowVersion(), is((Flow.NetflowVersion.V5))); assertThat(flow.getFlowRecords(), is(2)); assertThat(flow.getFlowSeqNum(), is(0L)); assertThat(flow.getEngineId(), is(0)); assertThat(flow.getEngineType(), is(0)); assertThat(flow.getSamplingInterval(), is(0.0)); assertThat(flow.getSamplingAlgorithm(), is(Flow.SamplingAlgorithm.Unassigned)); MatcherAssert.assertThat(flow.getSrcAddr(), equalTo("10.0.2.2")); MatcherAssert.assertThat(flow.getSrcAddrHostname(), equalTo(Optional.empty())); MatcherAssert.assertThat(flow.getSrcPort(), equalTo(54435)); MatcherAssert.assertThat(flow.getSrcMaskLen(), equalTo(0)); MatcherAssert.assertThat(flow.getDstAddr(), equalTo("10.0.2.15")); MatcherAssert.assertThat(flow.getDstAddrHostname(), equalTo(Optional.empty())); MatcherAssert.assertThat(flow.getDstPort(), equalTo(22)); MatcherAssert.assertThat(flow.getDstMaskLen(), equalTo(0)); MatcherAssert.assertThat(flow.getTcpFlags(), equalTo(16)); MatcherAssert.assertThat(flow.getProtocol(), equalTo(6)); MatcherAssert.assertThat(flow.getBytes(), equalTo(230L)); MatcherAssert.assertThat(flow.getInputSnmp(), equalTo(0)); MatcherAssert.assertThat(flow.getOutputSnmp(), equalTo(0)); MatcherAssert.assertThat(flow.getFirstSwitched(), equalTo(1434886852194L)); MatcherAssert.assertThat(flow.getLastSwitched(), equalTo(1430591887476L)); MatcherAssert.assertThat(flow.getPackets(), equalTo(5L)); MatcherAssert.assertThat(flow.getDirection(), equalTo(Flow.Direction.INGRESS)); MatcherAssert.assertThat(flow.getNextHop(), equalTo("0.0.0.0")); MatcherAssert.assertThat(flow.getNextHopHostname(), equalTo(Optional.empty())); MatcherAssert.assertThat(flow.getVlan(), nullValue()); }