### Question:
UserId { public String getUserId() { return userId; } 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 testGetUserId() throws Exception { UserId owner = new UserId(UserId.Type.owner, "hello"); assertEquals("owner", owner.getUserId(new FakeGadgetToken().setOwnerId("owner"))); UserId viewer = new UserId(UserId.Type.viewer, "hello"); assertEquals("viewer", viewer.getUserId(new FakeGadgetToken().setViewerId("viewer"))); UserId me = new UserId(UserId.Type.me, "hello"); assertEquals("viewer", me.getUserId(new FakeGadgetToken().setViewerId("viewer"))); UserId user = new UserId(UserId.Type.userId, "hello"); assertEquals("hello", user.getUserId(new FakeGadgetToken())); }