class NumberUtils {

  public static byte[] positiveToByteArray(final BigInteger positiveNumber) {
    if (null == positiveNumber) {
      return new byte[0];
    }
    assertTrue(positiveNumber.compareTo(BigInteger.ZERO) >= 0,
        "Argument must greater than or equals to 0");

    final byte[] raw = positiveNumber.toByteArray();
    final int positiveByteCapacity =
        positiveNumber.equals(BigInteger.ZERO) ? 1 : (positiveNumber.bitLength() + 7) >>> 3;
    if (raw.length > positiveByteCapacity) {
      return Arrays.copyOfRange(raw, 1, raw.length);
    }
    return raw;
  }

}