### Question:
SuApp { @Override public int hashCode() { int result = type.hashCode(); result = 31 * result + (packageName != null ? packageName.hashCode() : 0); result = 31 * result + (versionName != null ? versionName.hashCode() : 0); result = 31 * result + (versionCode != null ? versionCode.hashCode() : 0); result = 31 * result + (apkPath != null ? apkPath.hashCode() : 0); return result; } SuApp(SuBinary.Type type, @Nullable String pkg, @Nullable String versionName, @Nullable Integer versionCode, @Nullable String apkPath); SuBinary.Type getType(); @Nullable String getPackageName(); @Nullable String getVersionName(); @Nullable Integer getVersionCode(); @Nullable String getApkPath(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testEqualsHash() { final SuApp app1 = new SuApp(SuBinary.Type.NONE, "pkg", "vname", 1, "/path"); final SuApp app2 = new SuApp(SuBinary.Type.NONE, "pkg", "vname", 1, "/path"); final SuApp app3 = new SuApp(SuBinary.Type.NONE, "", "vname", 1, "/path"); assertThat(app1, is(app2)); assertThat(app2, is(not(app3))); assertThat(app1.hashCode(), is(app2.hashCode())); assertThat(app2.hashCode(), is(not(app3.hashCode()))); }