### Question:
IdCoder { public String getStringId(ObjectId id) { EntityIdCoder coder = getCoder(id.getEntityName()); return coder.toStringId(id); } IdCoder(EntityResolver entityResolver); ObjectId getObjectId(String id); String getStringId(ObjectId id); String getStringId(Persistent object);  }### Answer:
@Test public void testGetStringId() { IdCoder handler = new IdCoder(runtime.getChannel().getEntityResolver()); E1 e1 = new E1(); e1.setObjectId(ObjectId.of("E1", "ID", 5)); assertEquals("E1:5", handler.getStringId(e1)); }
@Test public void testGetStringId_ObjectId() { IdCoder handler = new IdCoder(runtime.getChannel().getEntityResolver()); assertEquals("E1:5", handler.getStringId(ObjectId.of("E1", "ID", 5))); }
@Test public void testGetStringId_Temp() { IdCoder handler = new IdCoder(runtime.getChannel().getEntityResolver()); byte[] key = new byte[] { 1, 2, 10, 100 }; E1 e1 = new E1(); e1.setObjectId(ObjectId.of("E1", key)); assertEquals(".E1:01020A64", handler.getStringId(e1)); }
@Test public void testGetSringId_TempWithReplacement() { IdCoder handler = new IdCoder(runtime.getChannel().getEntityResolver()); byte[] key = new byte[] { 5, 2, 11, 99 }; ObjectId id = ObjectId.of("E1", key); id.getReplacementIdMap().put("ID", 6); E1 e1 = new E1(); e1.setObjectId(id); assertEquals("E1:6", handler.getStringId(e1)); }