### Question:
AISBuilder { public AISBuilder string(int bits, CharSequence txt) { if ((bits % 6) != 0) { throw new IllegalArgumentException(bits+" not / 6"); } for (int ii=1;ii<=bits/6;ii++) { if (ii <= txt.length()) { char cc = txt.charAt(ii-1); if (cc > 64 && cc <= 95) { integer(6, cc - 64); } else { if (cc >= 32 && cc <= 63) { integer(6, cc); } else { throw new IllegalArgumentException(cc+" cannot be encoded in "+txt); } } } else { sb.append("000000"); } } return this; } AISBuilder();  AISBuilder(MessageTypes type, int mmsi); NMEASentence[] build(); AISBuilder string(int bits, CharSequence txt); AISBuilder rot(float rot); AISBuilder bool(boolean b); AISBuilder spare(int bits); AISBuilder decimal(int bits, double value, double coef); AISBuilder integer(int bits, Enum value, Enum def); AISBuilder integer(int bits, int value); AISBuilder polygon(Polygon polygon); AISBuilder polyline(Polygon polygon); AISBuilder circle(Circle circle); AISBuilder sector(Sector sector); AISBuilder associatedText(String text); static final NMEASentence[] EMPTY; }### Answer:
@Test public void testString() { AISBuilder builder = new AISBuilder(); String txt = "IIRIS 3231"; builder.string(120, txt); assertEquals(txt, AISUtil.makeString(builder.bits())); }