Dips { public static int screenHeightAsIntDips(@NonNull Context context) { Preconditions.checkNotNull(context); return pixelsToIntDips(context.getResources().getDisplayMetrics().heightPixels, context); }  static float pixelsToFloatDips(final float pixels, final Context context); static int pixelsToIntDips(final float pixels, final Context context); static float dipsToFloatPixels(final float dips, final Context context); static int dipsToIntPixels(final float dips, final Context context); static float asFloatPixels(float dips, Context context); static int asIntPixels(float dips, Context context); static int screenWidthAsIntDips(@NonNull Context context); static int screenHeightAsIntDips(@NonNull Context context);  }
@Test public void screenHeightAsIntDips_shouldReturnTheHeightAsDips() throws Exception { assertThat(Dips.screenHeightAsIntDips(activity)).isEqualTo(400); }