### Question:
AllowedMechanisms { public static AllowedMechanisms parse(final String allowedMechanismsProperty) throws IllegalArgumentException { final String[] parts = allowedMechanismsProperty.split("[,;\\s]"); final List<Long> mechs = new ArrayList<>(parts.length); for (String part : parts) { part = part.trim(); if (!part.isEmpty()) { try { if (part.startsWith("0x") && part.length() > 2) { mechs.add(Long.parseLong(part.substring(2), 16)); } else { if (part.startsWith("CKM_")) { part = part.substring("CKM_".length()); } Long l = MechanismNames.longFromName(part); if (l == null) { l = Long.parseLong(part); } mechs.add(l); } } catch (NumberFormatException ex) { throw new IllegalArgumentException("Mechanism could not be parsed as number: " + ex.getMessage()); } } } return new AllowedMechanisms(mechs); } AllowedMechanisms(List<Long> mechs); static AllowedMechanisms parse(final String allowedMechanismsProperty); static AllowedMechanisms fromBinaryEncoding(final byte[] binary); byte[] toBinaryEncoding(); Long[] toLongArray(); String toPropertyValue(); @Override String toString();  }### Answer:
@Test(expected = IllegalArgumentException.class) public void testParseHexAndDecimal_incorrectValue1() { LOG.info(">testParseHexAndDecimal_incorrectValue1"); String allowedMechanismsProperty = " 0x00000040, 0x00000000 0xnotANumber;0x252 ,624"; AllowedMechanisms.parse(allowedMechanismsProperty); }
@Test(expected = IllegalArgumentException.class) public void testParseHexAndDecimal_incorrectValue2() { LOG.info(">testParseHexAndDecimal_incorrectValue2"); String allowedMechanismsProperty = " 0x00000040, 0x00000000 notANumberNorConstant;0x252 ,624"; AllowedMechanisms.parse(allowedMechanismsProperty); }