@Override public String[] getPackagesToIgnore(AnnotatedElement element) { PowerMockIgnore annotation = element.getAnnotation(PowerMockIgnore.class); boolean useGlobal = true; if (annotation != null){ useGlobal = annotation.globalIgnore(); } Set<String> ignoredPackages = new HashSet<String>(); useGlobal &= extractPackageToIgnore(element, ignoredPackages); final String[] packageToIgnore = ignoredPackages.toArray(new String[ignoredPackages.size()]); if (useGlobal) { return getPackageToIgnoreWithGlobal(packageToIgnore); } else { return packageToIgnore; } }