### Question:
TCStringDecoder { public static TCString decode(String consentString, DecoderOption... options) throws IllegalArgumentException, ByteParseException, UnsupportedVersionException { EnumSet<DecoderOption> optSet = EnumSet.noneOf(DecoderOption.class); for (DecoderOption opt : options) { optSet.add(opt); } String[] split = consentString.split("\\."); String base64UrlEncodedString = split[0]; BitReader bitVector = vectorFromString(base64UrlEncodedString); int version = bitVector.readBits6(FieldDefs.CORE_VERSION); switch (version) { case 1: return TCStringV1.fromBitVector(bitVector); case 2: TCString tcString = null; if (split.length > 1) { BitReader[] remaining = new BitReader[split.length - 1]; for (int i = 1; i < split.length; i++) { remaining[i - 1] = vectorFromString(split[i]); } tcString = TCStringV2.fromBitVector(bitVector, remaining); } else { tcString = TCStringV2.fromBitVector(bitVector); } if (!optSet.contains(DecoderOption.LAZY)) { tcString.hashCode(); } return tcString; default: throw new UnsupportedVersionException("Version " + version + "is unsupported yet"); } }  static TCString decode(String consentString, DecoderOption... options);  }### Answer:
@Test public void testCanCreateModelFromTwoPartsString() { String tcString = "COtybn4PA_zT4KjACBENAPCIAEBAAECAAIAAAAAAAAAA.IFoEUQQgAIQwgIwQABAEAAAAOIAACAIAAAAQAIAgEAACEAAAAAgAQBAAAAAAAGBAAgAAAAAAAFAAECAAAgAAQARAEQAAAAAJAAIAAgAAAYQEAAAQmAgBC3ZAYzUw"; assertNotNull(TCStringDecoder.decode(tcString)); }
@Test public void testCanCreateModelOnePartString() { String tcString = "COtybn4PA_zT4KjACBENAPCIAEBAAECAAIAAAAAAAAAA"; assertNotNull(TCStringDecoder.decode(tcString)); }
@Test(expected = UnsupportedVersionException.class) public void shouldFailIfANonSupportedVersionIsPassed() { String tcString = Base64.getUrlEncoder().encodeToString(new byte[] { 13 }); TCStringDecoder.decode(tcString); }
@Test(expected = ByteParseException.class) public void testReadBeyondBuffer() { TCString tcString = TCString.decode("Bg"); tcString.getCreated(); }
@Test(expected = ByteParseException.class) public void testStrict() { TCString.decode("CA=="); }
@Test public void testLazy() { TCString.decode("CA==", DecoderOption.LAZY); }
@Test(expected = ByteParseException.class) public void testLazyFailure() { TCString.decode("CA==", DecoderOption.LAZY).getCmpId(); }