code: public ResourceList getResourcesWithExtension(final String extension) {
          if (closed.get()) {
              throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
          }
          final ResourceList allWhitelistedResources = getAllResources();
          if (allWhitelistedResources.isEmpty()) {
              return ResourceList.EMPTY_LIST;
          } else {
              String bareExtension = extension;
              while (bareExtension.startsWith(".")) {
                  bareExtension = bareExtension.substring(1);
              }
              final ResourceList filteredResources = new ResourceList();
              for (final Resource classpathResource : allWhitelistedResources) {
                  final String relativePath = classpathResource.getPath();
                  final int lastSlashIdx = relativePath.lastIndexOf('/');
                  final int lastDotIdx = relativePath.lastIndexOf('.');
                  if (lastDotIdx > lastSlashIdx
                          && relativePath.substring(lastDotIdx + 1).equalsIgnoreCase(bareExtension)) {
                      filteredResources.add(classpathResource);
                  }
              }
              return filteredResources;
          }
      }
docs: Get the list of all resources found in whitelisted packages that have the requested filename extension.
  
  @param extension
  A filename extension, e.g. "xml" to match all resources ending in ".xml".
  @return A list of all resources found in whitelisted packages that have the requested filename extension.