Thanks Daniel for the reply.
I tried this for below scenario:
graph = TinkerGraph.open()
g = graph.traversal()
v1 = graph.addVertex(id, "a", label, "a")
v2 = graph.addVertex(id, "b", label, "b")
v3 = graph.addVertex(id, "c", label, "c")
v1.addEdge("contains", v2)
v2.addEdge("contains", v3)
vertexList= ["b", "c"]
g.V().repeat(out().hasId(within(vertexList))).until(__.not(outE())).path()
==>[v[a],v[b],v[c]]
==>[v[b],v[c]]
however output should be empty as the relationship is a->b->c and here 'a' is not included in the vertexList. Am I missing something?