code: public static List<Resource> getChildrenByResourceType(final Resource resource, String resourceType) {
          final ArrayList<Resource> children = new ArrayList<>();
          if (resource != null) {
              for (final Resource child : resource.getChildren()) {
                  if (child.isResourceType(resourceType)) {
                      children.add(child);
                  }
              }
          }
          return children;
      }
docs: retrieves all children of a sling:resourceType