### Question:
SPPDecoder implements MALDecoder { @Override public MALListDecoder createListDecoder(final List list) throws IllegalArgumentException, MALException { if (list == null) { throw new IllegalArgumentException(ILLEGAL_NULL_ARGUMENT); } return new SPPListDecoder(inputStream, list, properties); } SPPDecoder(final InputStream inputStream, final Map properties); @Override Boolean decodeBoolean(); @Override Boolean decodeNullableBoolean(); @Override Float decodeFloat(); @Override Float decodeNullableFloat(); @Override Double decodeDouble(); @Override Double decodeNullableDouble(); @Override Byte decodeOctet(); @Override Byte decodeNullableOctet(); @Override UOctet decodeUOctet(); @Override UOctet decodeNullableUOctet(); @Override Short decodeShort(); @Override Short decodeNullableShort(); @Override UShort decodeUShort(); @Override UShort decodeNullableUShort(); @Override Integer decodeInteger(); @Override Integer decodeNullableInteger(); @Override UInteger decodeUInteger(); @Override UInteger decodeNullableUInteger(); @Override Long decodeLong(); @Override Long decodeNullableLong(); @Override ULong decodeULong(); @Override ULong decodeNullableULong(); @Override String decodeString(); @Override String decodeNullableString(); @Override Blob decodeBlob(); @Override Blob decodeNullableBlob(); @Override Duration decodeDuration(); @Override Duration decodeNullableDuration(); @Override FineTime decodeFineTime(); @Override FineTime decodeNullableFineTime(); @Override Identifier decodeIdentifier(); @Override Identifier decodeNullableIdentifier(); @Override Time decodeTime(); @Override Time decodeNullableTime(); @Override URI decodeURI(); @Override URI decodeNullableURI(); @Override Element decodeElement(final Element element); @Override Element decodeNullableElement(final Element element); @Override Attribute decodeAttribute(); @Override Attribute decodeNullableAttribute(); @Override MALListDecoder createListDecoder(final List list);  }### Answer:
@Test public void testCreateListDecoder1() throws Exception { List<Element> list = new ArrayList<>(); newBuffer(new byte[]{0}); MALListDecoder listDecoder = decoder.createListDecoder(list); assertEquals(false, listDecoder.hasNext()); }
@Test public void testCreateListDecoder2() throws Exception { List<Element> list = new ArrayList<>(); newBuffer(new byte[]{3}); MALListDecoder listDecoder = decoder.createListDecoder(list); assertEquals(true, listDecoder.hasNext()); }
@Test public void testCreateListDecoder3() throws Exception { List<Element> list = new ArrayList<>(); list.add(new Union(new Integer(42))); list.add(new URI("http: newBuffer(new byte[]{2}); MALListDecoder listDecoder = decoder.createListDecoder(list); assertEquals(false, listDecoder.hasNext()); }
@Test public void testCreateListDecoderExpectedException1() throws Exception { newBuffer(new byte[]{}); try { List<Element> list = new ArrayList<>(); MALListDecoder listDecoder = decoder.createListDecoder(list); fail("Expected exception, but none thrown."); } catch (MALException ex) { assertEquals(SPPDecoder.INSUFFICIENT_DATA, ex.getMessage()); } }
@Test public void testCreateListDecoderExpectedException2() throws Exception { newBuffer(new byte[]{}); try { MALListDecoder listDecoder = decoder.createListDecoder(null); fail("Expected exception, but none thrown."); } catch (IllegalArgumentException ex) { assertEquals(SPPEncoder.ILLEGAL_NULL_ARGUMENT, ex.getMessage()); } }