private Directory directoryWith(File[] jars) throws IOException {
Directory directory = mock(Directory.class);
File path = File.createTempFile("tomighty-random-dir-", null);
when(directory.filesByExtension("jar")).thenReturn(jars);
when(directory.path()).thenReturn(path);
return directory;
}