@Test public void testHashCode() { final ProjectScreenModel model = new ProjectScreenModel(); model.setPOM(new POM("test", "test", "url", new GAV("groupID", "artifactID", "version"))); final MavenRepository repository = new MavenRepository(); repository.setId("guvnor-m2-repo"); repository.setName("Guvnor M2 Repo"); repository.setUrl("http: model.getPOM().addRepository(repository); model.setPOMMetaData(new Metadata()); model.setKModule(new KModuleModel()); model.setKModuleMetaData(new Metadata()); model.setProjectTagsMetaData(new Metadata()); model.setProjectImports(new ProjectImports()); model.setProjectImportsMetaData(new Metadata()); final int hashCode1 = model.hashCode(); assertTrue(hashCode1 <= Integer.MAX_VALUE); assertTrue(hashCode1 >= Integer.MIN_VALUE); model.getProjectImports().getImports().addImport(new Import("java.lang.List")); final int hashCode2 = model.hashCode(); assertTrue(hashCode2 <= Integer.MAX_VALUE); assertTrue(hashCode2 >= Integer.MIN_VALUE); assertNotEquals(hashCode1, hashCode2); }
@Override public int hashCode() { int result = pom != null ? pom.hashCode() : 0; result = 31 * result + (pathToPOM != null ? pathToPOM.hashCode() : 0); result = ~~result; result = 31 * result + (POMMetaData != null ? POMMetaData.hashCode() : 0); result = ~~result; result = 31 * result + (KModule != null ? KModule.hashCode() : 0); result = ~~result; result = 31 * result + (gitUrls != null ? gitUrls.hashCode() : 0); result = ~~result; result = 31 * result + (pathToKModule != null ? pathToKModule.hashCode() : 0); result = ~~result; result = 31 * result + (KModuleMetaData != null ? KModuleMetaData.hashCode() : 0); result = ~~result; result = 31 * result + (projectImports != null ? projectImports.hashCode() : 0); result = ~~result; result = 31 * result + (pathToImports != null ? pathToImports.hashCode() : 0); result = ~~result; result = 31 * result + (projectImportsMetaData != null ? projectImportsMetaData.hashCode() : 0); result = ~~result; result = 31 * result + (projectTagsMetaData != null ? projectTagsMetaData.hashCode() : 0); result = ~~result; result = 31 * result + (whiteList != null ? whiteList.hashCode() : 0); result = ~~result; result = 31 * result + (pathToWhiteList != null ? pathToWhiteList.hashCode() : 0); result = ~~result; result = 31 * result + (whiteListMetaData != null ? whiteListMetaData.hashCode() : 0); result = ~~result; result = 31 * result + (repositories != null ? repositories.hashCode() : 0); result = ~~result; result = 31 * result + (pathToRepositories != null ? pathToRepositories.hashCode() : 0); result = ~~result; return result; }
ProjectScreenModel { @Override public int hashCode() { int result = pom != null ? pom.hashCode() : 0; result = 31 * result + (pathToPOM != null ? pathToPOM.hashCode() : 0); result = ~~result; result = 31 * result + (POMMetaData != null ? POMMetaData.hashCode() : 0); result = ~~result; result = 31 * result + (KModule != null ? KModule.hashCode() : 0); result = ~~result; result = 31 * result + (gitUrls != null ? gitUrls.hashCode() : 0); result = ~~result; result = 31 * result + (pathToKModule != null ? pathToKModule.hashCode() : 0); result = ~~result; result = 31 * result + (KModuleMetaData != null ? KModuleMetaData.hashCode() : 0); result = ~~result; result = 31 * result + (projectImports != null ? projectImports.hashCode() : 0); result = ~~result; result = 31 * result + (pathToImports != null ? pathToImports.hashCode() : 0); result = ~~result; result = 31 * result + (projectImportsMetaData != null ? projectImportsMetaData.hashCode() : 0); result = ~~result; result = 31 * result + (projectTagsMetaData != null ? projectTagsMetaData.hashCode() : 0); result = ~~result; result = 31 * result + (whiteList != null ? whiteList.hashCode() : 0); result = ~~result; result = 31 * result + (pathToWhiteList != null ? pathToWhiteList.hashCode() : 0); result = ~~result; result = 31 * result + (whiteListMetaData != null ? whiteListMetaData.hashCode() : 0); result = ~~result; result = 31 * result + (repositories != null ? repositories.hashCode() : 0); result = ~~result; result = 31 * result + (pathToRepositories != null ? pathToRepositories.hashCode() : 0); result = ~~result; return result; } }
ProjectScreenModel { @Override public int hashCode() { int result = pom != null ? pom.hashCode() : 0; result = 31 * result + (pathToPOM != null ? pathToPOM.hashCode() : 0); result = ~~result; result = 31 * result + (POMMetaData != null ? POMMetaData.hashCode() : 0); result = ~~result; result = 31 * result + (KModule != null ? KModule.hashCode() : 0); result = ~~result; result = 31 * result + (gitUrls != null ? gitUrls.hashCode() : 0); result = ~~result; result = 31 * result + (pathToKModule != null ? pathToKModule.hashCode() : 0); result = ~~result; result = 31 * result + (KModuleMetaData != null ? KModuleMetaData.hashCode() : 0); result = ~~result; result = 31 * result + (projectImports != null ? projectImports.hashCode() : 0); result = ~~result; result = 31 * result + (pathToImports != null ? pathToImports.hashCode() : 0); result = ~~result; result = 31 * result + (projectImportsMetaData != null ? projectImportsMetaData.hashCode() : 0); result = ~~result; result = 31 * result + (projectTagsMetaData != null ? projectTagsMetaData.hashCode() : 0); result = ~~result; result = 31 * result + (whiteList != null ? whiteList.hashCode() : 0); result = ~~result; result = 31 * result + (pathToWhiteList != null ? pathToWhiteList.hashCode() : 0); result = ~~result; result = 31 * result + (whiteListMetaData != null ? whiteListMetaData.hashCode() : 0); result = ~~result; result = 31 * result + (repositories != null ? repositories.hashCode() : 0); result = ~~result; result = 31 * result + (pathToRepositories != null ? pathToRepositories.hashCode() : 0); result = ~~result; return result; }  }
ProjectScreenModel { @Override public int hashCode() { int result = pom != null ? pom.hashCode() : 0; result = 31 * result + (pathToPOM != null ? pathToPOM.hashCode() : 0); result = ~~result; result = 31 * result + (POMMetaData != null ? POMMetaData.hashCode() : 0); result = ~~result; result = 31 * result + (KModule != null ? KModule.hashCode() : 0); result = ~~result; result = 31 * result + (gitUrls != null ? gitUrls.hashCode() : 0); result = ~~result; result = 31 * result + (pathToKModule != null ? pathToKModule.hashCode() : 0); result = ~~result; result = 31 * result + (KModuleMetaData != null ? KModuleMetaData.hashCode() : 0); result = ~~result; result = 31 * result + (projectImports != null ? projectImports.hashCode() : 0); result = ~~result; result = 31 * result + (pathToImports != null ? pathToImports.hashCode() : 0); result = ~~result; result = 31 * result + (projectImportsMetaData != null ? projectImportsMetaData.hashCode() : 0); result = ~~result; result = 31 * result + (projectTagsMetaData != null ? projectTagsMetaData.hashCode() : 0); result = ~~result; result = 31 * result + (whiteList != null ? whiteList.hashCode() : 0); result = ~~result; result = 31 * result + (pathToWhiteList != null ? pathToWhiteList.hashCode() : 0); result = ~~result; result = 31 * result + (whiteListMetaData != null ? whiteListMetaData.hashCode() : 0); result = ~~result; result = 31 * result + (repositories != null ? repositories.hashCode() : 0); result = ~~result; result = 31 * result + (pathToRepositories != null ? pathToRepositories.hashCode() : 0); result = ~~result; return result; }  POM getPOM(); void setPOM(final POM pom); KModuleModel getKModule(); void setKModule(final KModuleModel KModule); List<GitUrl> getGitUrls(); void setGitUrls(final List<GitUrl> gitUrls); ProjectImports getProjectImports(); void setProjectImports(final ProjectImports projectImports); ModuleRepositories getRepositories(); void setRepositories(final ModuleRepositories repositories); WhiteList getWhiteList(); void setWhiteList(final WhiteList whiteList); Metadata getPOMMetaData(); void setPOMMetaData(final Metadata POMMetaData); Metadata getKModuleMetaData(); void setKModuleMetaData(final Metadata KModuleMetaData); Metadata getProjectImportsMetaData(); void setProjectImportsMetaData(final Metadata projectImportsMetaData); Metadata getProjectTagsMetaData(); void setProjectTagsMetaData(final Metadata projectTagsMetaData); Metadata getWhiteListMetaData(); void setWhiteListMetaData(final Metadata whiteListMetaData); Path getPathToPOM(); void setPathToPOM(final Path pathToPOM); Path getPathToKModule(); void setPathToKModule(final Path pathToKModule); Path getPathToImports(); void setPathToImports(final Path pathToImports); Path getPathToRepositories(); void setPathToRepositories(final Path pathToRepositories); Path getPathToWhiteList(); void setPathToWhiteList(final Path pathToWhiteList); @Override boolean equals(Object o); @Override int hashCode(); }
ProjectScreenModel { @Override public int hashCode() { int result = pom != null ? pom.hashCode() : 0; result = 31 * result + (pathToPOM != null ? pathToPOM.hashCode() : 0); result = ~~result; result = 31 * result + (POMMetaData != null ? POMMetaData.hashCode() : 0); result = ~~result; result = 31 * result + (KModule != null ? KModule.hashCode() : 0); result = ~~result; result = 31 * result + (gitUrls != null ? gitUrls.hashCode() : 0); result = ~~result; result = 31 * result + (pathToKModule != null ? pathToKModule.hashCode() : 0); result = ~~result; result = 31 * result + (KModuleMetaData != null ? KModuleMetaData.hashCode() : 0); result = ~~result; result = 31 * result + (projectImports != null ? projectImports.hashCode() : 0); result = ~~result; result = 31 * result + (pathToImports != null ? pathToImports.hashCode() : 0); result = ~~result; result = 31 * result + (projectImportsMetaData != null ? projectImportsMetaData.hashCode() : 0); result = ~~result; result = 31 * result + (projectTagsMetaData != null ? projectTagsMetaData.hashCode() : 0); result = ~~result; result = 31 * result + (whiteList != null ? whiteList.hashCode() : 0); result = ~~result; result = 31 * result + (pathToWhiteList != null ? pathToWhiteList.hashCode() : 0); result = ~~result; result = 31 * result + (whiteListMetaData != null ? whiteListMetaData.hashCode() : 0); result = ~~result; result = 31 * result + (repositories != null ? repositories.hashCode() : 0); result = ~~result; result = 31 * result + (pathToRepositories != null ? pathToRepositories.hashCode() : 0); result = ~~result; return result; }  POM getPOM(); void setPOM(final POM pom); KModuleModel getKModule(); void setKModule(final KModuleModel KModule); List<GitUrl> getGitUrls(); void setGitUrls(final List<GitUrl> gitUrls); ProjectImports getProjectImports(); void setProjectImports(final ProjectImports projectImports); ModuleRepositories getRepositories(); void setRepositories(final ModuleRepositories repositories); WhiteList getWhiteList(); void setWhiteList(final WhiteList whiteList); Metadata getPOMMetaData(); void setPOMMetaData(final Metadata POMMetaData); Metadata getKModuleMetaData(); void setKModuleMetaData(final Metadata KModuleMetaData); Metadata getProjectImportsMetaData(); void setProjectImportsMetaData(final Metadata projectImportsMetaData); Metadata getProjectTagsMetaData(); void setProjectTagsMetaData(final Metadata projectTagsMetaData); Metadata getWhiteListMetaData(); void setWhiteListMetaData(final Metadata whiteListMetaData); Path getPathToPOM(); void setPathToPOM(final Path pathToPOM); Path getPathToKModule(); void setPathToKModule(final Path pathToKModule); Path getPathToImports(); void setPathToImports(final Path pathToImports); Path getPathToRepositories(); void setPathToRepositories(final Path pathToRepositories); Path getPathToWhiteList(); void setPathToWhiteList(final Path pathToWhiteList); @Override boolean equals(Object o); @Override int hashCode();  }