public static HeightLock ofBlockHeight(int blockHeight) {
        if (blockHeight < 0)
            throw new IllegalArgumentException("illegal negative block height: " + blockHeight);
        if (blockHeight >= THRESHOLD)
            throw new IllegalArgumentException("block height too high: " + blockHeight);
        return new HeightLock(blockHeight);
    }
@Test
    public void ofBlockHeight() {
        assertEquals(1, LockTime.ofBlockHeight(1).blockHeight());
        assertEquals(499_999_999, LockTime.ofBlockHeight((int) LockTime.THRESHOLD - 1).blockHeight());
    }