### Question:
DataWord implements Comparable<DataWord> { public DataWord signExtend(byte k) { if (0 > k || k > 31) throw new IndexOutOfBoundsException(); byte mask = this.sValue().testBit((k * 8) + 7) ? (byte) 0xff : 0; byte[] newData = this.copyData(); for (int i = 31; i > k; i--) { newData[31 - i] = mask; } return new DataWord(newData); } private  DataWord(byte[] data); static DataWord of(byte[] data); static DataWord of(ByteArrayWrapper wrappedData); @JsonCreator static DataWord of(String data); static DataWord of(byte num); static DataWord of(int num); static DataWord of(long num); byte[] getData(); byte[] getNoLeadZeroesData(); byte[] getLast20Bytes(); BigInteger value(); int intValue(); int intValueSafe(); long longValue(); long longValueSafe(); BigInteger sValue(); String bigIntValue(); boolean isZero(); boolean isNegative(); DataWord and(DataWord word); DataWord or(DataWord word); DataWord xor(DataWord word); DataWord negate(); DataWord bnot(); DataWord add(DataWord word); DataWord add2(DataWord word); DataWord mul(DataWord word); DataWord div(DataWord word); DataWord sDiv(DataWord word); DataWord sub(DataWord word); DataWord exp(DataWord word); DataWord mod(DataWord word); DataWord sMod(DataWord word); DataWord addmod(DataWord word1, DataWord word2); DataWord mulmod(DataWord word1, DataWord word2); DataWord shiftLeft(DataWord arg); DataWord shiftRight(DataWord arg); DataWord shiftRightSigned(DataWord arg); @JsonValue @Override String toString(); String toPrefixString(); String shortHex(); @Override boolean equals(Object o); @Override int hashCode(); @Override int compareTo(DataWord o); DataWord signExtend(byte k); int bytesOccupied(); boolean isHex(String hex); String asString(); static final int MAX_POW; static final BigInteger _2_256; static final BigInteger MAX_VALUE; static final DataWord ZERO; static final DataWord ONE; static final long MEM_SIZE; }### Answer:
@Test(expected = IndexOutOfBoundsException.class) public void testSignExtendException1() { byte k = -1; DataWord x = DataWord.ZERO; x.signExtend(k); }
@Test(expected = IndexOutOfBoundsException.class) public void testSignExtendException2() { byte k = 32; DataWord x = DataWord.ZERO; x.signExtend(k); }