InputConfigurationCompat { @Override public int hashCode() { return mImpl.hashCode(); } InputConfigurationCompat(int width, int height, int format); private  InputConfigurationCompat(@NonNull InputConfigurationCompatImpl impl); @Nullable static InputConfigurationCompat wrap(@Nullable Object inputConfiguration); int getWidth(); int getHeight(); int getFormat(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); @Nullable Object unwrap();  }
@Test public void canCompare() { InputConfigurationCompat compat1 = new InputConfigurationCompat(WIDTH, HEIGHT, FORMAT); InputConfigurationCompat compat2 = new InputConfigurationCompat(WIDTH, HEIGHT, FORMAT); InputConfigurationCompat compat3 = new InputConfigurationCompat(HEIGHT, WIDTH, FORMAT); assertThat(compat1).isEqualTo(compat1); assertThat(compat1).isEqualTo(compat2); assertThat(compat1).isNotEqualTo(compat3); assertThat(compat1.hashCode()).isEqualTo(compat1.hashCode()); assertThat(compat1.hashCode()).isEqualTo(compat2.hashCode()); assertThat(compat1.hashCode()).isNotEqualTo(compat3.hashCode()); }
@Test @Config(minSdk = Build.VERSION_CODES.M) public void baseImplHashCodeMatchesFramework() { InputConfigurationCompat.InputConfigurationCompatBaseImpl baseImpl = new InputConfigurationCompat.InputConfigurationCompatBaseImpl(WIDTH, HEIGHT, FORMAT); InputConfiguration config = new InputConfiguration(WIDTH, HEIGHT, FORMAT); assertThat(baseImpl.hashCode()).isEqualTo(config.hashCode()); }