if (numOfStars == 1) {
return Arrays.<PathElement>asList(new StarSinglePathElement(key));
} else if (numOfStars == 2) {
return Arrays.<PathElement>asList(new StarDoublePathElement(key));
} else if (numOfStars > 2) {
return Arrays.<PathElement>asList(new StarRegexPathElement(key));
} else {
return Arrays.<PathElement>asList(new LiteralPathElement(key));
}
}