Source:
<code>public List<DocumentModel> getDocumentsForComment(DocumentModel comment) { return CoreInstance.doPrivileged(comment.getRepositoryName(), session -> { <START> Map<String, Object> ctxMap = Collections.<String, Object> singletonMap( <END> ResourceAdapter.CORE_SESSION_CONTEXT_KEY, session); RelationManager relationManager = Framework.getService(RelationManager.class); Graph graph = relationManager.getGraph(config.graphName, session); Resource commentResource = relationManager.getResource(config.commentNamespace, comment, ctxMap); if (commentResource == null) { throw new NuxeoException("Could not adapt document model to relation resource ; " + "check the service relation adapters configuration"); } Resource predicate = new ResourceImpl(config.predicateNamespace); List<Statement> statementList = graph.getStatements(commentResource, predicate, null); if (graph instanceof JenaGraph) { Resource oldDocResource = new QNameResourceImpl(config.commentNamespace, comment.getId()); statementList.addAll(graph.getStatements(oldDocResource, predicate, null)); } List<DocumentModel> docList = new ArrayList<DocumentModel>(); for (Statement stmt : statementList) { QNameResourceImpl subject = (QNameResourceImpl) stmt.getObject(); DocumentModel docModel = (DocumentModel) relationManager.getResourceRepresentation( config.documentNamespace, subject, ctxMap); if (docModel == null) { log.warn("Could not adapt comment relation subject to a document " + "model; check the service relation adapters configuration"); continue; } docModel.detach(true); docList.add(docModel); } return docList; }); }</code><technical_language>Collections.<String, Object> singletonMap replaced Collections.singletonMap</technical_language>

Target:
public List<DocumentModel> getDocumentsForComment(DocumentModel comment) { return doPrivileged(comment.getCoreSession(), comment.getRepositoryName(), session -> { Map<String, Object> ctxMap = Collections.<String, Object>singletonMap(ResourceAdapter.CORE_SESSION_CONTEXT_KEY, session); RelationManager relationManager = Framework.getService(RelationManager.class); Graph graph = relationManager.getGraph(config.graphName, session); Resource commentResource = relationManager.getResource(config.commentNamespace, comment, ctxMap); if (commentResource == null) { throw new NuxeoException("Could not adapt document model to relation resource ; " + "check the service relation adapters configuration"); } Resource predicate = new ResourceImpl(config.predicateNamespace); List<Statement> statementList = graph.getStatements(commentResource, predicate, null); if (graph instanceof JenaGraph) { Resource oldDocResource = new QNameResourceImpl(config.commentNamespace, comment.getId()); statementList.addAll(graph.getStatements(oldDocResource, predicate, null)); } List<DocumentModel> docList = new ArrayList<DocumentModel>(); for (Statement stmt : statementList) { QNameResourceImpl subject = (QNameResourceImpl) stmt.getObject(); DocumentModel docModel = (DocumentModel) relationManager.getResourceRepresentation(config.documentNamespace, subject, ctxMap); if (docModel == null) { log.warn("Could not adapt comment relation subject to a document " + "model; check the service relation adapters configuration"); continue; } docModel.detach(true); docList.add(docModel); } return docList; }); }