@Test public void testAddUserToPaidGroup() throws Exception { User user = new User("Paid User"); UserGroup.addUserToPaidGroup(user); assertTrue(UserGroup.isPaid(user)); }
public static void addUserToPaidGroup(final User user) throws IllegalArgumentException { if (freeGroup.contains(user)) { throw new IllegalArgumentException("User all ready member of free group."); } else { if (!paidGroup.contains(user)) { paidGroup.add(user); } } }
UserGroup { public static void addUserToPaidGroup(final User user) throws IllegalArgumentException { if (freeGroup.contains(user)) { throw new IllegalArgumentException("User all ready member of free group."); } else { if (!paidGroup.contains(user)) { paidGroup.add(user); } } } }
UserGroup { public static void addUserToPaidGroup(final User user) throws IllegalArgumentException { if (freeGroup.contains(user)) { throw new IllegalArgumentException("User all ready member of free group."); } else { if (!paidGroup.contains(user)) { paidGroup.add(user); } } }  }
UserGroup { public static void addUserToPaidGroup(final User user) throws IllegalArgumentException { if (freeGroup.contains(user)) { throw new IllegalArgumentException("User all ready member of free group."); } else { if (!paidGroup.contains(user)) { paidGroup.add(user); } } }  static void addUserToFreeGroup(final User user); static void addUserToPaidGroup(final User user); static boolean isPaid(User user); }
UserGroup { public static void addUserToPaidGroup(final User user) throws IllegalArgumentException { if (freeGroup.contains(user)) { throw new IllegalArgumentException("User all ready member of free group."); } else { if (!paidGroup.contains(user)) { paidGroup.add(user); } } }  static void addUserToFreeGroup(final User user); static void addUserToPaidGroup(final User user); static boolean isPaid(User user);  }