@Test public void removeOpenId() { User user = new User("user", "password", "email", false); OpenId openId2 = new OpenId("openId2", "realId2"); Set<OpenId> openIds = Sets.newHashSet( new OpenId("openId1", "realId1"), openId2); for (OpenId openId : openIds) { user.addOpenId(openId); } user.removeOpenId(openId2.getDelegateId()); openIds.remove(openId2); assertEquals(openIds, user.getOpenIds()); }
public void removeOpenId(String openId) { for (Iterator<OpenId> iter = openIds.iterator(); iter.hasNext();) { OpenId id = iter.next(); if (id.getDelegateId().equals(openId)) { iter.remove(); } } }
User { public void removeOpenId(String openId) { for (Iterator<OpenId> iter = openIds.iterator(); iter.hasNext();) { OpenId id = iter.next(); if (id.getDelegateId().equals(openId)) { iter.remove(); } } } }
User { public void removeOpenId(String openId) { for (Iterator<OpenId> iter = openIds.iterator(); iter.hasNext();) { OpenId id = iter.next(); if (id.getDelegateId().equals(openId)) { iter.remove(); } } } User(String loginName, String password, String email, boolean disabled); }
User { public void removeOpenId(String openId) { for (Iterator<OpenId> iter = openIds.iterator(); iter.hasNext();) { OpenId id = iter.next(); if (id.getDelegateId().equals(openId)) { iter.remove(); } } } User(String loginName, String password, String email, boolean disabled); void addOpenId(OpenId openId); void removeOpenId(String openId); }
User { public void removeOpenId(String openId) { for (Iterator<OpenId> iter = openIds.iterator(); iter.hasNext();) { OpenId id = iter.next(); if (id.getDelegateId().equals(openId)) { iter.remove(); } } } User(String loginName, String password, String email, boolean disabled); void addOpenId(OpenId openId); void removeOpenId(String openId);  }