JarLibraryDependency implements Serializable { @Nullable public static JarLibraryDependency copy(@NotNull IdeaSingleEntryLibraryDependency original) { File binaryPath = original.getFile(); if (binaryPath != null) { String scope = null; IdeaDependencyScope originalScope = original.getScope(); if (originalScope != null) { scope = originalScope.getScope(); } boolean resolved = isResolved(original); String name; if (resolved) { name = binaryPath.isFile() ? getNameWithoutExtension(binaryPath) : sanitizeFileName(binaryPath.getPath()); } else { name = getUnresolvedDependencyName(original); if (name == null) { return null; } } return new JarLibraryDependency(name, binaryPath, original.getSource(), original.getJavadoc(), scope, resolved); } return null; } JarLibraryDependency(@NotNull String name,
                              @Nullable File binaryPath,
                              @Nullable File sourcePath,
                              @Nullable File javadocPath,
                              @Nullable String scope,
                              boolean resolved); @Nullable static JarLibraryDependency copy(@NotNull IdeaSingleEntryLibraryDependency original); @NotNull String getName(); @Nullable File getBinaryPath(); @Nullable File getSourcePath(); @Nullable File getJavadocPath(); @Nullable String getScope(); boolean isResolved();  }
@Test public void testCopyWithNullBinaryPath() { expect(myOriginalDependency.getFile()).andStubReturn(null); replay(myOriginalDependency); assertNull(JarLibraryDependency.copy(myOriginalDependency)); verify(myOriginalDependency); }