### Question:
UserId { public final static UserId fromString(String userIdString) { try { int dateIndex = userIdString.indexOf(':'); String dateValue = null; String userName = null; if ( dateIndex != -1 ) { dateValue = userIdString.substring(0, dateIndex); userName = userIdString.substring(dateIndex+1); } if ( dateValue != null && userName != null ) { int timeMillis = StringUtil.toInt(dateValue, -1); if ( timeMillis == -1 ) { return null; } UserId userId = new UserId(userName, timeMillis); return userId; } return null; } catch (Exception e) { return null; } } UserId(String userName);  UserId(String userName, int registerDate);  UserId(String userName, int registerDate, byte[] internal); byte[] getInternal(); String getUserName(); int getRegisterDate(); @SuppressWarnings("deprecation") final String toString(); final String convertToString(); @Override int hashCode(); @Override boolean equals(Object obj); final static UserId valueOf(String userIdString); final static UserId fromString(String userIdString); final static UserId fromBytes(byte[] bytes);  }### Answer:
@Test public void testFromString() { UserId userId = null; userId = UserId.fromString("2012/02/29:宝贝战争"); assertNull(userId); userId = UserId.fromString("1330358400:宝贝战争"); assertEquals(1330358400, userId.getRegisterDate()); assertEquals("宝贝战争", userId.getUserName()); }