public static Stamp intToLong(IntegerStamp intStamp) { long mask; if (intStamp.isPositive()) { mask = intStamp.mask(); } else { mask = 0xffffffff00000000L | intStamp.mask(); } return StampFactory.forInteger(Kind.Long, intStamp.lowerBound(), intStamp.upperBound(), mask); }