App { public static boolean isCompatible(int apiLevel) { return android.os.Build.VERSION.SDK_INT >= apiLevel; } private  App(); static boolean isCompatible(int apiLevel); static String getVersion(); static void setExactAlarm(AlarmManager alarmManager, long triggerAtMillis, PendingIntent operation); @Nullable static String getPhotoUrl(@Nullable Session session);  }
@Test public void should_return_true_when_api_is_compatible() { int apiLevelCompatible = android.os.Build.VERSION.SDK_INT; int apiLevelBelow = android.os.Build.VERSION.SDK_INT - 1; boolean result1 = App.isCompatible(apiLevelCompatible); boolean result2 = App.isCompatible(apiLevelBelow); assertThat(result1).isTrue(); assertThat(result2).isTrue(); }
@Test public void should_return_false_when_api_is_incompatible() { int apiLevelIncompatible = android.os.Build.VERSION.SDK_INT + 1; boolean result = App.isCompatible(apiLevelIncompatible); assertThat(result).isFalse(); }