Make your dependency filter depend on the Dependency Object, instead of just the file name. 
Refactor class so that getPackagedDependency(StringFilter format) calls getPackagedDependency(format, null) and check for that before calling filter.include. That'll avoid duplicating the getPackagedDependency code. Same for getUnpackagedDependency