### Question:
UserId { public static UserId fromJson(String jsonId) { Type idSpecEnum = Type.jsonValueOf(jsonId); if (idSpecEnum != null) { return new UserId(idSpecEnum, null); } return new UserId(Type.userId, jsonId); } UserId(Type type, String userId); Type getType(); String getUserId(); String getUserId(SecurityToken token); static UserId fromJson(String jsonId); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testFromJson() throws Exception { UserId owner = UserId.fromJson("@owner"); assertEquals(UserId.Type.owner, owner.getType()); UserId viewer = UserId.fromJson("@viewer"); assertEquals(UserId.Type.viewer, viewer.getType()); UserId me = UserId.fromJson("@me"); assertEquals(UserId.Type.me, me.getType()); UserId user = UserId.fromJson("john.doe"); assertEquals(UserId.Type.userId, user.getType()); assertEquals("john.doe", user.getUserId()); }