#354 Fixed CheckStyle Issues
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>java-design-patterns</artifactId>
|
||||
|
@ -3,11 +3,18 @@ package com.iluwatar.featuretoggle.user;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Contains the lists of users of different groups paid and free
|
||||
*/
|
||||
public class UserGroup {
|
||||
|
||||
private static List<User> freeGroup = new ArrayList<>();
|
||||
private static List<User> paidGroup = new ArrayList<>();
|
||||
|
||||
/**
|
||||
*
|
||||
* @param user {@link User} to be added to the free group
|
||||
*/
|
||||
public static void addUserToFreeGroup(final User user) {
|
||||
if (paidGroup.contains(user)) {
|
||||
throw new IllegalArgumentException("User all ready member of paid group.");
|
||||
@ -18,6 +25,10 @@ public class UserGroup {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param user {@link User} to be added to the paid group
|
||||
*/
|
||||
public static void addUserToPaidGroup(final User user) {
|
||||
if (freeGroup.contains(user)) {
|
||||
throw new IllegalArgumentException("User all ready member of free group.");
|
||||
|
@ -6,7 +6,7 @@ import com.iluwatar.featuretoggle.user.UserGroup;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class TieredFeatureToggleVersionTest {
|
||||
|
||||
|
Reference in New Issue
Block a user