public static AztecCode encode(String data) {
    return encode(data.getBytes(StandardCharsets.ISO_8859_1));
  }
@Test
  public void testAztecWriter() throws Exception {
    testWriter("Espa\u00F1ol", null, 25, true, 1);                   // Without ECI (implicit ISO-8859-1)
    testWriter("Espa\u00F1ol", ISO_8859_1, 25, true, 1);             // Explicit ISO-8859-1
    testWriter("\u20AC 1 sample data.", WINDOWS_1252, 25, true, 2);  // ISO-8859-1 can't encode Euro; Windows-1252 can
    testWriter("\u20AC 1 sample data.", ISO_8859_15, 25, true, 2);
    testWriter("\u20AC 1 sample data.", UTF_8, 25, true, 2);
    testWriter("\u20AC 1 sample data.", UTF_8, 100, true, 3);
    testWriter("\u20AC 1 sample data.", UTF_8, 300, true, 4);
    testWriter("\u20AC 1 sample data.", UTF_8, 500, false, 5);
    testWriter("The capital of Japan is named \u6771\u4EAC.", SHIFT_JIS, 25, true, 3);
    // Test AztecWriter defaults
    String data = "In ut magna vel mauris malesuada";
    AztecWriter writer = new AztecWriter();
    BitMatrix matrix = writer.encode(data, BarcodeFormat.AZTEC, 0, 0);
    AztecCode aztec = Encoder.encode(data,
        Encoder.DEFAULT_EC_PERCENT, Encoder.DEFAULT_AZTEC_LAYERS);
    BitMatrix expectedMatrix = aztec.getMatrix();
    assertEquals(matrix, expectedMatrix);
  }