### Question:
VotingKey extends Key { public static VotingKey fromHexString(final String hex) { return new VotingKey(hex); } VotingKey(byte[] bytes);  VotingKey(BigInteger value);  VotingKey(String hex); static VotingKey fromHexString(final String hex); static VotingKey generateRandom(); static final int SIZE; }### Answer:
@Test public void canCreateFromHexString() { final VotingKey key = VotingKey.fromHexString("227F"); Assertions.assertEquals(VotingKey.SIZE, key.getSize()); MatcherAssert.assertThat( key.getBytes(), IsEqual.equalTo(ByteUtils.byteArrayLeadingZeros(new byte[] {0x22, 0x7F}, VotingKey.SIZE))); }
@Test public void cannotCreateAroundMalformedHexString() { Assertions.assertThrows(IllegalArgumentException.class, () -> VotingKey.fromHexString("22G75")); }