### Question:
GroupId { public static GroupId fromJson(String jsonId) throws IllegalArgumentException { return new GroupId(jsonId); } GroupId(Object objectId);  GroupId(Type type, String objectId); Type getType(); void setObjectId(String objectId); Object getObjectId(); static GroupId fromJson(String jsonId); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testFromJson() { 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.objectId, group.getType()); assertEquals("superbia", group.getObjectId().toString()); GroupId unknown = GroupId.fromJson("@foo"); assertEquals(Type.custom, unknown.getType()); assertEquals("@foo", unknown.getObjectId().toString()); }