@Test
public void bigIntToByteArray_withALeadingZero() throws Exception {

  int expectedSize = 2048;
  BigInteger bigIntWithALeadingZero;
  while (true) {
    bigIntWithALeadingZero = new BigInteger(2048, new Random());
    byte[] r = bigIntWithALeadingZero.toByteArray();
    if (r[0] == 0) {
      break;
    }
  }
  byte[] modBytes = RsaKem.bigIntToByteArray(bigIntWithALeadingZero, expectedSize);
  assertThat(modBytes).hasLength(expectedSize);
  assertThat(new BigInteger(1, modBytes)).isEqualTo(bigIntWithALeadingZero);
}