I have string lists look like this:
List parentDataList: {\"this\", \"is\", \"a\", \"test\", \"string\", \"and\", \"a\", \"test\", \"other\"}
The method Collections.indexOfSubList will give you the desired information.
Returns the starting position of the first occurrence of the specified target list within the specified source list, or -1 if there is no such occurrence. More formally, returns the lowest index i such that source.subList(i, i+target.size()).equals(target), or -1 if there is no such index. (Returns -1 if target.size() > source.size().)
int index=Collections.indexOfSubList(parentDataList, child1);
…
The index interval will be from index
, inclusive, to index+child1.size()
, exclusive. Unless the returned index is -1
, of course. In the latter case the sublist was not found.