use iterator instead of String[] in getExcludes method