@Test public void testHashcode() { assertEquals( new PackageItem("", PackageItem.DEFAULT_PACKAGE_NAME).hashCode(), new PackageItem("", PackageItem.DEFAULT_PACKAGE_NAME).hashCode()); assertEquals( new PackageItem("org.test", "org.test").hashCode(), new PackageItem("org.test", "org.test").hashCode()); assertNotEquals( new PackageItem("org.test", "org.test").hashCode(), new PackageItem("", PackageItem.DEFAULT_PACKAGE_NAME).hashCode()); }
@Override public int hashCode() { int result = packageName.hashCode(); result = ~~result; result = 31 * result + caption.hashCode(); result = ~~result; return result; }
PackageItem { @Override public int hashCode() { int result = packageName.hashCode(); result = ~~result; result = 31 * result + caption.hashCode(); result = ~~result; return result; } }
PackageItem { @Override public int hashCode() { int result = packageName.hashCode(); result = ~~result; result = 31 * result + caption.hashCode(); result = ~~result; return result; } PackageItem();  PackageItem(final String packageName,
                       final String caption); }
PackageItem { @Override public int hashCode() { int result = packageName.hashCode(); result = ~~result; result = 31 * result + caption.hashCode(); result = ~~result; return result; } PackageItem();  PackageItem(final String packageName,
                       final String caption); String getPackageName(); String getCaption(); @Override boolean equals(Object o); @Override int hashCode(); }
PackageItem { @Override public int hashCode() { int result = packageName.hashCode(); result = ~~result; result = 31 * result + caption.hashCode(); result = ~~result; return result; } PackageItem();  PackageItem(final String packageName,
                       final String caption); String getPackageName(); String getCaption(); @Override boolean equals(Object o); @Override int hashCode(); static final String DEFAULT_PACKAGE_NAME; }