     (.addListener runner (CwRunListener.))
     (.run runner (into-array [fixture-class]))))
 
+(defn- file-names [files]
+  (for [{:keys [:file-name]} files
+        :when (not (nil? file-name))]
+    file-name))
+
 (defmethod solution-only "java"
   [{:keys [:setup :solution]}]
   (let [dir (TempDir/create "java")
-        setup (when (not (empty? setup)) (util/write-code! "java" dir setup))
-        solution (util/write-code! "java" dir solution)
-        files (for [{:keys [:file-name]} [setup solution]
-                    :when (not (nil? file-name))]
-                file-name)]
+        setup (when (not (empty? setup)) (write-code! "java" dir setup))
+        solution (write-code! "java" dir solution)
+        files (file-names [setup solution])]
     (apply compile! files)
     (-> solution
         :class-name

(defmethod full-project "java"
  [{:keys [:fixture :setup :solution]}]
  (let [dir (TempDir/create "java")
        fixture (util/write-code! "java" dir fixture)
        setup (when (not (empty? setup)) (util/write-code! "java" dir setup))
        solution (util/write-code! "java" dir solution)
        files (for [{:keys [:file-name]} [fixture setup solution]
                    :when (not (nil? file-name))]
                file-name)]
    (apply compile! files)
    (->> fixture :class-name (load-class dir) run-junit-tests)))

(ns codewars.runner
  (:require [codewars.runner :refer [run]]
            [clojure.java.io :as io]
            [codewars.util :refer [write-code!]])
  (:import [codewars.java TempDir]
           [java.net URLClassLoader]
           [javax.tools ToolProvider]
