Source:
<code>ServicePolicy getDomainServicePolicyFromTransportServicePolicy( com.iovation.launchkey.sdk.transport.domain.ServicePolicy policy) { if (policy.getMinimumRequirements().isEmpty() && policy.getGeoFences().isEmpty() && policy.getTimeFences().isEmpty() && policy.getFactors().isEmpty() && policy.getDeviceIntegrity() == null) { <START> return null; <END> } List<ServicePolicy.Location> geoFences = new ArrayList<>(); for (AuthPolicy.Location location : policy.getGeoFences()) { geoFences.add(new ServicePolicy.Location(location.getName(), location.getRadius(), location.getLatitude(), location.getLongitude())); } List<ServicePolicy.TimeFence> timeFences = new ArrayList<>(); for (com.iovation.launchkey.sdk.transport.domain.ServicePolicy.TimeFence timeFence : policy.getTimeFences()) { List<ServicePolicy.Day> days = new ArrayList<>(); for (String day : timeFence.getDays()) { days.add(ServicePolicy.Day.fromString(day)); } timeFences.add(new ServicePolicy.TimeFence(timeFence.getName(), days, timeFence.getStartHour(), timeFence.getStartMinute(), timeFence.getEndHour(), timeFence.getEndMinute(), TimeZone.getTimeZone(timeFence.getTimezone()))); } Integer any; Boolean knowledge, inherence, possession; if (policy.getMinimumRequirements().isEmpty()) { any = null; knowledge = inherence = possession = null; } else { any = policy.getMinimumRequirements().get(0).getAny(); knowledge = policy.getMinimumRequirements().get(0).getKnowledge() == null ? null : policy.getMinimumRequirements().get(0).getKnowledge() == 1; inherence = policy.getMinimumRequirements().get(0).getInherence() == null ? null : policy.getMinimumRequirements().get(0).getInherence() == 1; possession = policy.getMinimumRequirements().get(0).getPossession() == null ? null : policy.getMinimumRequirements().get(0).getPossession() == 1; } return new ServicePolicy(any, knowledge, inherence, possession, policy.getDeviceIntegrity(), geoFences, timeFences); }</code><technical_language>return policy object instead of null</technical_language>

Target:
ServicePolicy getDomainServicePolicyFromTransportServicePolicy( com.iovation.launchkey.sdk.transport.domain.ServicePolicy policy) { List<ServicePolicy.Location> geoFences = new ArrayList<>(); for (AuthPolicy.Location location : policy.getGeoFences()) { geoFences.add(new ServicePolicy.Location(location.getName(), location.getRadius(), location.getLatitude(), location.getLongitude())); } List<ServicePolicy.TimeFence> timeFences = new ArrayList<>(); for (com.iovation.launchkey.sdk.transport.domain.ServicePolicy.TimeFence timeFence : policy.getTimeFences()) { List<ServicePolicy.Day> days = new ArrayList<>(); for (String day : timeFence.getDays()) { days.add(ServicePolicy.Day.fromString(day)); } timeFences.add(new ServicePolicy.TimeFence(timeFence.getName(), days, timeFence.getStartHour(), timeFence.getStartMinute(), timeFence.getEndHour(), timeFence.getEndMinute(), TimeZone.getTimeZone(timeFence.getTimezone()))); } Integer any; Boolean knowledge, inherence, possession; if (policy.getMinimumRequirements().isEmpty()) { any = null; knowledge = inherence = possession = null; } else { any = policy.getMinimumRequirements().get(0).getAny(); knowledge = policy.getMinimumRequirements().get(0).getKnowledge() == null ? null : policy.getMinimumRequirements().get(0).getKnowledge() == 1; inherence = policy.getMinimumRequirements().get(0).getInherence() == null ? null : policy.getMinimumRequirements().get(0).getInherence() == 1; possession = policy.getMinimumRequirements().get(0).getPossession() == null ? null : policy.getMinimumRequirements().get(0).getPossession() == 1; } return new ServicePolicy(any, knowledge, inherence, possession, policy.getDeviceIntegrity(), geoFences, timeFences); }