AgencyAndId implements Serializable, Comparable<AgencyAndId> { public static String convertToString(AgencyAndId aid) { if( aid == null) return null; return aid.getAgencyId() + ID_SEPARATOR + aid.getId(); } AgencyAndId();  AgencyAndId(String agencyId, String id); String getAgencyId(); void setAgencyId(String agencyId); String getId(); void setId(String id); boolean hasValues(); int compareTo(AgencyAndId o); static AgencyAndId convertFromString(String value, char separator); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); static AgencyAndId convertFromString(String value); static String convertToString(AgencyAndId aid); static final char ID_SEPARATOR; }
@Test public void testConvertToString() { AgencyAndId id = new AgencyAndId("a","b"); assertEquals("a_b",AgencyAndId.convertToString(id)); }