### Question:
TLVList implements Serializable, Loggeable { public TLVMsg findNextTLV() throws IllegalStateException { if (tagToFind < 0) throw new IllegalStateException( "The initialization of the searched tag is required" ); for ( int i=indexLastOccurrence + 1 ; i < tags.size(); i++) { if (tags.get(i).getTag() == tagToFind) { indexLastOccurrence = i; return tags.get(i); } } return null; } TLVList(); void unpack(byte[] buf); List<TLVMsg> getTags(); Enumeration<TLVMsg> elements(); void unpack(byte[] buf, int offset); void append(TLVMsg tlv); TLVList append(int tag, byte[] value); TLVList append(int tag, String value); void deleteByIndex(int index); void deleteByTag(int tag); TLVMsg find(int tag); int findIndex(int tag); TLVMsg findNextTLV(); TLVMsg index(int index); byte[] pack(); String getString(int tag); byte[] getValue(int tag); boolean hasTag(int tag); @Override void dump(PrintStream p, String indent);  }### Answer:
@Test public void testFindNextTLV() { instance.findIndex(TEST_TAG1); instance.append(TEST_TAG3, new byte[0]); TLVMsg result = instance.findNextTLV(); assertNull(result); }
@Test public void testFindNextTLVThrowsIllegalStateExeption2() { assertThrows(IllegalStateException.class, () -> { instance.findNextTLV(); }); }