Based on your comments & question for migration this is what I am suggesting: Map<LinkRelation, Optional<Link>> links = new HashMap<LinkRelation, Optional<Link>>(); links.put(IanaLinkRelations.SELF, Optional.of(response.getLink(IanaLinkRelations.SELF))); links.put(IanaLinkRelations.NEXT, Optional.of(response.getLink(IanaLinkRelations.NEXT))); links.put(IanaLinkRelations.PREVIOUS, Optional.of(response.getLink(IanaLinkRelations.PREVIOUS))); …. //calling addLinlk addLink(apmCoreBaseUrl, response, links, IanaLinkRelations.SELF); addLink(apmCoreBaseUrl, response, links, IanaLinkRelations.NEXT); addLink(apmCoreBaseUrl, response, links, IanaLinkRelations.PREVIOUS); And inside addLink: private void addLink(String baseUrl, RegistrationsResource response, Map<LinkRelation, Optional> links, LinkRelation … Read more