Preconditions { public static boolean isAtLeastAndroidLollipop() { return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP; }  static void checkNotNull(Object object, String message); static void checkNotNullOrEmpty(String string, String message); static void checkGreaterOrEqualToZero(int number, String message); static void checkGreaterThanZero(int number, String message); static boolean isAtLeastAndroidLollipop(); static boolean isAtLeastAndroidMarshmallow();  }
@Test @Config(sdk = 21) public void shouldBeAtLeastAndroidLollipop() { boolean isAtLeastAndroidLollipop = Preconditions.isAtLeastAndroidLollipop(); assertThat(isAtLeastAndroidLollipop).isTrue(); }
@Test @Config(sdk = 22) public void shouldBeAtLeastAndroidLollipopForHigherApi() { boolean isAtLeastAndroidLollipop = Preconditions.isAtLeastAndroidLollipop(); assertThat(isAtLeastAndroidLollipop).isTrue(); }