State () { State result = new State(); for (Map.Entry<String, List<File>> entry : myFiles.entrySet()) { DownloadedLibraryState libraryState = new DownloadedLibraryState(); libraryState.myId = entry.getKey(); for (File file : entry.getValue()) { libraryState.myPaths.add(FileUtil.toSystemIndependentName(file.getAbsolutePath())); } result.myLibraries.add(libraryState); } return result; }