My source string is /study[2]/
When I do
String[] tokens = itemPath.split("/");
the result is
[, study[2]]
tokens is String[2]
I was under the impression that the Split method removed all empty tokens? Why is it keeping the 1st one? I shouldn't get this according to Java String split removed empty values