@Test
  public void testGetAndroidApiLevel() throws Exception {
    try {
      Class<?> buildVersion = Class.forName("android.os.Build$VERSION");
      int expectedVersion = buildVersion.getDeclaredField("SDK_INT").getInt(null);
      assertThat(Util.getAndroidApiLevel()).isEqualTo(expectedVersion);
    } catch (ReflectiveOperationException e) {
      assertThat(Util.getAndroidApiLevel()).isEqualTo(null);
    }
  }
Tests for Tink internal Util class.
java_src/src/test/java/com/google/crypto/tink/internal/UtilTest.java