You should add a comment here that explaining that walk.setRecursive(false) must be used if includeTrees is true.

I wonder if we shouldn't add a check for this misuse:

  if (includeTrees && walk.isRecursive())
    throw new IllegalArgumentException(...);