@Test public void testShiftIpAddressIntoSubnetMax() { Prefix shiftIntoPrefix = Prefix.parse("5.5.0.32/32"); Transformation transformation = always().apply(shiftDestinationIp(shiftIntoPrefix)).build(); Transition transition = _toTransition.toTransition(transformation); BDD expectedOut = _dstIpSpaceToBdd.toBDD(shiftIntoPrefix); BDD actualOut = transition.transitForward(_one); assertThat(actualOut, equalTo(expectedOut)); BDD in = _dstIpSpaceToBdd.toBDD(Prefix.parse("1.2.3.12/32")); expectedOut = _dstIpSpaceToBdd.toBDD(Prefix.parse("5.5.0.32/32")); actualOut = transition.transitForward(in); assertThat(actualOut, equalTo(expectedOut)); actualOut = transition.transitForward(expectedOut); assertThat(actualOut, equalTo(expectedOut)); BDD expectedIn = _one; BDD actualIn = transition.transitBackward(_one); assertThat(actualIn, equalTo(expectedIn)); expectedIn = _one; actualIn = transition.transitBackward(expectedOut); assertThat(actualIn, equalTo(expectedIn)); }
public Transition toTransition(@Nullable Transformation transformation) { return transformation == null ? IDENTITY : _cache.computeIfAbsent(transformation, this::computeTransition); }
TransformationToTransition { public Transition toTransition(@Nullable Transformation transformation) { return transformation == null ? IDENTITY : _cache.computeIfAbsent(transformation, this::computeTransition); } }
TransformationToTransition { public Transition toTransition(@Nullable Transformation transformation) { return transformation == null ? IDENTITY : _cache.computeIfAbsent(transformation, this::computeTransition); } TransformationToTransition(BDDPacket bddPacket, IpAccessListToBdd ipAccessListToBdd); }
TransformationToTransition { public Transition toTransition(@Nullable Transformation transformation) { return transformation == null ? IDENTITY : _cache.computeIfAbsent(transformation, this::computeTransition); } TransformationToTransition(BDDPacket bddPacket, IpAccessListToBdd ipAccessListToBdd); Transition toTransition(@Nullable Transformation transformation); Transition toReturnFlowTransition(@Nullable Transformation transformation); }
TransformationToTransition { public Transition toTransition(@Nullable Transformation transformation) { return transformation == null ? IDENTITY : _cache.computeIfAbsent(transformation, this::computeTransition); } TransformationToTransition(BDDPacket bddPacket, IpAccessListToBdd ipAccessListToBdd); Transition toTransition(@Nullable Transformation transformation); Transition toReturnFlowTransition(@Nullable Transformation transformation);  }