### Question:
ECRECPrecompiledContract extends AbstractPrecompiledContract { @Override public Bytes compute(final Bytes input, final MessageFrame messageFrame) { final int size = input.size(); final Bytes d = size >= 128 ? input : Bytes.wrap(input, MutableBytes.create(128 - size)); final Bytes32 h = Bytes32.wrap(d, 0); if (!d.slice(32, 31).isZero()) { return Bytes.EMPTY; } final int recId = d.get(63) - V_BASE; final BigInteger r = d.slice(64, 32).toUnsignedBigInteger(); final BigInteger s = d.slice(96, 32).toUnsignedBigInteger(); final Signature signature; try { signature = Signature.create(r, s, (byte) recId); } catch (final IllegalArgumentException e) { return Bytes.EMPTY; } try { final Optional<PublicKey> recovered = PublicKey.recoverFromSignature(h, signature); if (!recovered.isPresent()) { return Bytes.EMPTY; } final Bytes32 hashed = Hash.hash(recovered.get().getEncodedBytes()); final MutableBytes32 result = MutableBytes32.create(); hashed.slice(12).copyTo(result, 12); return result; } catch (final IllegalArgumentException e) { return Bytes.EMPTY; } } ECRECPrecompiledContract(final GasCalculator gasCalculator); @Override Gas gasRequirement(final Bytes input); @Override Bytes compute(final Bytes input, final MessageFrame messageFrame);  }### Answer:
@Test public void shouldRecoverAddress() { final Bytes input = Bytes.fromHexString(this.input); final Bytes expected = expectedResult == null ? Bytes.EMPTY : Bytes32.fromHexString(expectedResult); assertThat(contract.compute(input, messageFrame)).isEqualTo(expected); }