### Question:
GroupId { public static GroupId fromJson(String jsonId) { Type idSpecEnum = Type.jsonValueOf(jsonId); if (idSpecEnum != null) { return new GroupId(idSpecEnum, null); } return new GroupId(Type.groupId, jsonId); } GroupId(Type type, String groupId); Type getType(); String getGroupId(); static GroupId fromJson(String jsonId); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testFromJson() throws Exception { GroupId all = GroupId.fromJson("@all"); assertEquals(GroupId.Type.all, all.getType()); GroupId friends = GroupId.fromJson("@friends"); assertEquals(GroupId.Type.friends, friends.getType()); GroupId self = GroupId.fromJson("@self"); assertEquals(GroupId.Type.self, self.getType()); GroupId group = GroupId.fromJson("superbia"); assertEquals(GroupId.Type.groupId, group.getType()); assertEquals("superbia", group.getGroupId()); }