OnUsField { @Override public String toString() { StringBuffer sb = new StringBuffer(20); if (optionalField4.length() > 0) { sb.append(optionalField4); sb.append("/"); } if (accountNumber.length() > 0) { sb.append(accountNumber); sb.append("/"); } else { if (sb.length() > 0) { sb.append("/"); } } if (tranCode.length() > 0) { sb.append(tranCode); } String s = sb.toString(); if (s.length() > 20) { s = s.substring(s.length() - 20); } if (s.length() < 20) { s = STRING_20.substring(0, 20 - s.length()) + s; } return s; } @SuppressWarnings("unused") private  OnUsField();  OnUsField(String value);  OnUsField(String optionalField4,
                     String accountNumber,
                     String tranCode); static OnUsField valueOf(String onusValue); String getOptionalField4(); String getAccountNumber(); String getTranCode(); @Override boolean equals(Object anObject); @Override String toString(); static final String STRING_20; }
@Test public void testToString() throws Exception { assertEquals(" 12345/20", testField.toString()); }