Methods are isolated blocks of code, with one entry point and many exit points.
If, e.g. on node #11 you had:
type = 2;
you would draw an arrow from #11 to a special node that represents foo(). The exit of this special node would point to #16.
If the reader of your diagram wants to understand what is inside foo(), he/she can look at another ...
Was looking for an answer myself, but don't know about the java binding or whatever the code pasted above was. I'm using the python bindings on version 1.9.20 this is what worked for me.
tls = testlink.TestLinkHelper().connect(testlink.TestlinkAPIClient)
projects = tls.getProjects()
suiteroots = tls.getFirstLevelTestSuitesForTestProject(projects['id'])