Source:
<code>private SubscriptionDescriptor toDescriptor(Subscription subscription, SecurityContext securityContext, Set<String> resolvedRoles) { List<Link> links; if (!"sas-community".equals(subscription.getPlanId())) { final UriBuilder uriBuilder = getServiceContext().getServiceUriBuilder(); links = new ArrayList<>(3); links.add(createLink(HttpMethod.GET, Constants.LINK_REL_GET_SUBSCRIPTION, null, MediaType.APPLICATION_JSON, uriBuilder.clone() .path(getClass(), "getSubscriptionById") .build(subscription.getId()) .toString() )); if (securityContext.isUserInRole("account/owner") || securityContext.isUserInRole("system/admin") || securityContext.isUserInRole("system/manager") || (securityContext.isUserInRole("user") && resolvedRoles != null && resolvedRoles.contains("account/owner"))) { links.add(createLink(HttpMethod.DELETE, Constants.LINK_REL_REMOVE_SUBSCRIPTION, null, null, uriBuilder.clone() .path(getClass(), "removeSubscription") .build(subscription.getId()) .toString() )); links.add(createLink(HttpMethod.GET, Constants.LINK_REL_GET_SUBSCRIPTION_ATTRIBUTES, null, MediaType.APPLICATION_JSON, uriBuilder.clone() .path(getClass(), "getSubscriptionAttributes") .build(subscription.getId()) .toString() )); } } else { <START> links = Collections.emptyList(); <END> } return DtoFactory.getInstance().createDto(SubscriptionDescriptor.class) .withId(subscription.getId()) .withAccountId(subscription.getAccountId()) .withServiceId(subscription.getServiceId()) .withProperties(subscription.getProperties()) .withPlanId(subscription.getPlanId()) .withLinks(links); }</code><technical_language>i <code>links = Collections.emptyList();</code> is do right! declare new list in method start java private SubscriptionDescriptor toDescriptor(...) { final List<Link> links = new LinkedList<>(); ... } get rid of needed <strike>unnecessary</strike> <code>else</code> statement</technical_language>

Target:
private SubscriptionDescriptor toDescriptor(Subscription subscription, SecurityContext securityContext, Set<String> resolvedRoles) { List<Link> links = new ArrayList<>(0); if (!"sas-community".equals(subscription.getPlanId())) { final UriBuilder uriBuilder = getServiceContext().getServiceUriBuilder(); links.add(createLink(HttpMethod.GET, Constants.LINK_REL_GET_SUBSCRIPTION, null, MediaType.APPLICATION_JSON, uriBuilder.clone() .path(getClass(), "getSubscriptionById") .build(subscription.getId()) .toString() )); if (securityContext.isUserInRole("account/owner") || securityContext.isUserInRole("system/admin") || securityContext.isUserInRole("system/manager") || (securityContext.isUserInRole("user") && resolvedRoles != null && resolvedRoles.contains("account/owner"))) { links.add(createLink(HttpMethod.DELETE, Constants.LINK_REL_REMOVE_SUBSCRIPTION, null, null, uriBuilder.clone() .path(getClass(), "removeSubscription") .build(subscription.getId()) .toString() )); links.add(createLink(HttpMethod.GET, Constants.LINK_REL_GET_SUBSCRIPTION_ATTRIBUTES, null, MediaType.APPLICATION_JSON, uriBuilder.clone() .path(getClass(), "getSubscriptionAttributes") .build(subscription.getId()) .toString() )); } } return DtoFactory.getInstance().createDto(SubscriptionDescriptor.class) .withId(subscription.getId()) .withAccountId(subscription.getAccountId()) .withServiceId(subscription.getServiceId()) .withProperties(subscription.getProperties()) .withPlanId(subscription.getPlanId()) .withLinks(links); }