import declarations are not intended to declare classes used by your code; they simply declare what to use to resolve unqualified identifiers. Therefore, if you use the unqualified Path identifier in your code, you should use import java.nio.file.Path; to declare that it must be authorized for this qualified type. By the way, this is not the only way to resolve the name. Names can also be resolved through class inheritance, for example. if they match the simple name of the inherited member class.
If you use a type implicitly without referring to its name, you do not need an import statement that is not limited to lambda expressions; it is not even a special function of Java 8. For example. from
Files.walk(Paths.get("C:/Users/mbmas_000/Downloads/SEC Edgar"), 1)
you already use the Path type implicitly as its Paths.get return Paths.get and the Files.walk parameter Files.walk , in other words, you get an instance of java.nio.file.Path and pass it to another method without referring to its type name, so you don't need import . Next, you call the varargs method, which accepts an arbitrary number of instances of FileVisitOption . You do not specify any, so your code will create an array of FileVisitOption[] with zero length and pass it to Files.walk , again, without import .
With improved type inference, there is another possibility to use a type without reference to its name, for example. if you call:
Files.newByteChannel(path, new HashSet<>());
You not only create an array with a zero length FileAttribute[] for the varargs parameter, without accessing this type by name, you also create a HashSet<OpenOption> without referring to the OpenOption type by name. So it also doesn’t require either import of java.nio.file.attribute.FileAttribute or java.nio.file.OpenOption .
So, the bottom line: whether you need import does not depend on the use of this type, but whether you refer to it by a simple name (and there are several ways to use a type without reference to it by name). In the second example, you refer to the Path name in your printPath(Path passedFilePath) method; if you change it to printPath(Object passedFilePath) , everything will work again without explicit import java.nio.file.Path .