how to combine Adjacent keywords into a multi-word keyword

hello everyone , please can anyone help me !!
I have a list of keywords i used TextRank algorithme, and i have list of all words ,I want to combine Adjacent kaywords into a multi-word keyword depending on their position in the list of all words with java.
For exemple :

Keywords :[ management ,activities ,such ,accounting ,risk ,project ,performance]

list of all words : [ "A", "cloud", "service", "for", "managing", "business", "activities", "such", "accounting",",", "procurement", "project", "management",",","risk", "management"," performance","."]

Result of multi-Keywords : [ "risk management" ,"activities such accounting","project","management performance"]

please help me :(