### Question:
BCodec extends RFC1522Codec implements StringEncoder, StringDecoder { @Override public String decode(final String value) throws DecoderException { if (value == null) { return null; } try { return this.decodeText(value); } catch (final UnsupportedEncodingException e) { throw new DecoderException(e.getMessage(), e); } } BCodec();  BCodec(final Charset charset);  BCodec(final String charsetName); String encode(final String value, final Charset charset); String encode(final String value, final String charset); @Override String encode(final String value); @Override String decode(final String value); @Override Object encode(final Object value); @Override Object decode(final Object value); Charset getCharset(); String getDefaultCharset();  }### Answer:
@Test public void testDecodeStringWithNull() throws Exception { final BCodec bcodec = new BCodec(); final String test = null; final String result = bcodec.decode(test); assertEquals("Result should be null", null, result); }
@Test public void testDecodeObjects() throws Exception { final BCodec bcodec = new BCodec(); final String decoded = "=?UTF-8?B?d2hhdCBub3Q=?="; final String plain = (String) bcodec.decode((Object) decoded); assertEquals("Basic B decoding test", "what not", plain); final Object result = bcodec.decode((Object) null); assertEquals("Decoding a null Object should return null", null, result); try { final Object dObj = new Double(3.0); bcodec.decode(dObj); fail("Trying to url encode a Double object should cause an exception."); } catch (final DecoderException ee) { } }