### Question:
LLDPOrganizationalTLV extends LLDPTLV { public LLDPOrganizationalTLV setInfoString(byte[] infoString) { if (infoString.length > MAX_INFOSTRING_LENGTH) { throw new IllegalArgumentException("The length of infoString cannot exceed " + MAX_INFOSTRING_LENGTH); } this.infoString = Arrays.copyOf(infoString, infoString.length); return this; } LLDPOrganizationalTLV(); LLDPOrganizationalTLV setOUI(byte[] oui); byte[] getOUI(); LLDPOrganizationalTLV setSubType(byte subType); byte getSubType(); LLDPOrganizationalTLV setInfoString(byte[] infoString); LLDPOrganizationalTLV setInfoString(String infoString); byte[] getInfoString(); @Override byte[] serialize(); @Override LLDPTLV deserialize(ByteBuffer bb); @Override int hashCode(); @Override boolean equals(Object obj); static final int OUI_LENGTH; static final int SUBTYPE_LENGTH; static final byte ORGANIZATIONAL_TLV_TYPE; static final int MAX_INFOSTRING_LENGTH; }### Answer:
@Test(expected = IllegalArgumentException.class) public void testLongInfoString() { LLDPOrganizationalTLV tlv = new LLDPOrganizationalTLV(); tlv.setInfoString(new byte[LLDPOrganizationalTLV.MAX_INFOSTRING_LENGTH + 1]); }
@Test public void testMaxInfoString() { LLDPOrganizationalTLV tlv = new LLDPOrganizationalTLV(); tlv.setInfoString(new byte[LLDPOrganizationalTLV.MAX_INFOSTRING_LENGTH]); }