Change:
final List<String> jcrPathSegments = new ArrayList<String>();

to:
final List<String> jcrPathSegments = new ArrayList<>();