### Question:
TLVList implements Serializable, Loggeable { public void deleteByTag(int tag) { List<TLVMsg> t = new ArrayList<>(); for (TLVMsg tlv2 : tags) { if (tlv2.getTag() == tag) t.add(tlv2); } tags.removeAll(t); } 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 testDeleteByTag() { instance.append(TEST_TAG1, new byte[1]); instance.append(TEST_TAG2, new byte[0]); instance.deleteByTag(TEST_TAG1); assertFalse(instance.getTags().isEmpty()); }