ResidueNumber implements Serializable, Comparable<ResidueNumber> { public String toPDB() { String insCodeS ; if ( insCode != null) insCodeS = insCode+""; else insCodeS = " "; return String.format("%s%4d%-2s", chainId, seqNum, insCodeS); } ResidueNumber();  ResidueNumber(String chainId, Integer residueNumber, Character insCode); String getChainId(); void setChainId(String chainId); Character getInsCode(); void setInsCode(Character insCode); Integer getSeqNum(); void setSeqNum(Integer seqNum); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); String toPDB(); static ResidueNumber fromString(String pdb_code); int compareTo(ResidueNumber other); String printFull();  }
@Test public void testToPDB() { ResidueNumber instance = new ResidueNumber("A", 42, ' '); ResidueNumber instance2 = new ResidueNumber("A", 42, null); String expResult = "A 42 "; String result1 = instance.toPDB(); assertEquals(expResult, result1); String result2 = instance2.toPDB(); assertEquals(expResult, result2); }