 (defn nNotPrivateConstructors [cl]
   (.size (getNotPrivateConstructors cl)))
 
+; ============================================
+; Methods
+; ============================================
+
+(defn getMethods [cl]
+  (filter (fn [m] (instance? MethodDeclaration m)) (.getMembers cl)))
+
+; ============================================
+; Fields
+; ============================================
+
+(defn getFields [cl]
+  (filter (fn [m] (instance? FieldDeclaration m)) (.getMembers cl)))
+
+; ============================================
+; Nodes
+; ============================================
+
+(defn getChildrenNodes [root]
+  (tree-seq
+   #(not-empty (.getChildrenNodes %))
+   #(.getChildrenNodes %)
+   root))
+
 (defn getParameters [m]
   (let [ps (.getParameters m)]
     (if (nil? ps)
       (java.util.ArrayList.)
       ps)))
 
-(defn getChildrenNodes [root]
-  (tree-seq
-   #(not-empty (.getChildrenNodes %))
-   #(.getChildrenNodes %)
-   root))
+; ============================================
+; Get Nodes of a certain type
+; ============================================
 
 (defn getMethodCallExprs [root]
   (filter #(instance? MethodCallExpr %)

  (flatten
   (for [cl (allClassesForCus cus)]
     (getConstructors cl))))

(defn getMethods [cl]
  (filter (fn [m] (instance? MethodDeclaration m)) (.getMembers cl)))

(defn getFields [cl]
  (filter (fn [m] (instance? FieldDeclaration m)) (.getMembers cl)))

(defn getNotPrivateConstructors [cl]
  (filter isNotPrivate? (getConstructors cl)))

(import com.github.javaparser.ast.expr.VariableDeclarationExpr)
(import com.github.javaparser.ast.body.VariableDeclarator)
(import com.github.javaparser.ast.body.VariableDeclaratorId)

; ============================================
; Access type declarations
; ============================================

(defn topLevelTypes [cu]
  "List of toplevel types: classes, interfaces and enums not contained in other types"
