public MetaString(
      String string, Encoding encoding, char specialChar1, char specialChar2, byte[] bytes) {
    this.string = string;
    this.encoding = encoding;
    this.specialChar1 = specialChar1;
    this.specialChar2 = specialChar2;
    this.bytes = bytes;
    if (encoding != Encoding.UTF_8) {
      Preconditions.checkArgument(bytes.length > 0);
      this.stripLastChar = (bytes[0] & 0x80) != 0;
    } else {
      this.stripLastChar = false;
    }
  }
@Test(dataProvider = "specialChars")
  public void testMetaString(char specialChar1, char specialChar2) {
    MetaStringEncoder encoder = new MetaStringEncoder(specialChar1, specialChar2);
    for (int i = 1; i < 128; i++) {
      try {
        String str = createString(i, specialChar1, specialChar2);
        MetaString metaString = encoder.encode(str);
        assertNotSame(metaString.getEncoding(), MetaString.Encoding.UTF_8);
        assertEquals(metaString.getString(), str);
        assertEquals(metaString.getSpecialChar1(), specialChar1);
        assertEquals(metaString.getSpecialChar2(), specialChar2);
        MetaStringDecoder decoder = new MetaStringDecoder(specialChar1, specialChar2);
        String newStr = decoder.decode(metaString.getBytes(), metaString.getEncoding());
        assertEquals(newStr, str);
      } catch (Throwable e) {
        throw new RuntimeException("Failed at " + i, e);
      }
    }
  }