### Question:
AsnUintCodecUL extends AsnOctetStringBasedObjectCodec<UnsignedLong> { @Override public UnsignedLong decode() { try { return UnsignedLong.valueOf(new BigInteger(1, getBytes())); } catch (Exception e) { if (defaultValue.isPresent()) { logger.warn( "Variable Unsigned Integer was too big for VarUInt: {}. Returning UnsignedLong.Max", Base64.getEncoder().encodeToString(getBytes()) ); return defaultValue.get(); } else { throw e; } } } AsnUintCodecUL();  AsnUintCodecUL(final UnsignedLong defaultValue); @Override UnsignedLong decode(); @Override void encode(final UnsignedLong value);  }### Answer:
@Test public void decode() { codec = new AsnUintCodecUL(); codec.setBytes(new byte[]{1}); assertThat(codec.decode()).isEqualTo(UnsignedLong.ONE); }
@Test public void decodeValueTooLarge() { codec = new AsnUintCodecUL(UnsignedLong.ONE); byte[] bytes = new BigInteger("18446744073709551616").toByteArray(); codec.setBytes(bytes); assertThat(codec.decode()).isEqualTo(UnsignedLong.ONE); }