diff --git a/README.md b/README.md
index 83a18e83c..323ffd785 100644
--- a/README.md
+++ b/README.md
@@ -285,6 +285,15 @@
* there is a concurrent access in object creation, e.g. singleton, where you want to create single instance of the same class and checking if it's null or not maybe not be enough when there are two or more threads that checks if instance is null or not.
* there is a concurrent access on a method where method's behaviour changes according to the some constraints and these constraint change within this method.
+##Servant
+**Intent:** Servant is used for providing some behavior to a group of classes. Instead of defining that behavior in each class - or when we cannot factor out this behavior in the common parent class - it is defined once in the Servant.
+
+
+
+**Applicability:** Use the Servant pattern when
+* When we want some objects to perform a common action and don't want to define this action as a method in every class.
+
+
# Frequently asked questions
**Q: What is the difference between State and Strategy patterns?**
diff --git a/pom.xml b/pom.xml
index bf19295bb..1e6b6e98c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -36,6 +36,7 @@
template-method
visitor
double-checked-locking
+ servant
@@ -53,4 +54,4 @@
-
+
\ No newline at end of file
diff --git a/servant/etc/servant.jpg b/servant/etc/servant.jpg
new file mode 100644
index 000000000..d7ea66267
Binary files /dev/null and b/servant/etc/servant.jpg differ
diff --git a/servant/etc/servant.svg b/servant/etc/servant.svg
new file mode 100644
index 000000000..c4891c79f
--- /dev/null
+++ b/servant/etc/servant.svg
@@ -0,0 +1,259 @@
+
+
+
diff --git a/servant/etc/servant.xml b/servant/etc/servant.xml
new file mode 100644
index 000000000..8da8a9e0b
--- /dev/null
+++ b/servant/etc/servant.xml
@@ -0,0 +1,638 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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file mode 100644
index 000000000..41dd5ce33
--- /dev/null
+++ b/servant/pom.xml
@@ -0,0 +1,21 @@
+
+
+ 4.0.0
+
+ com.iluwatar
+ java-design-patterns
+ 1.0-SNAPSHOT
+
+ servant
+ servant
+ http://maven.apache.org
+
+
+ junit
+ junit
+ 3.8.1
+ test
+
+
+
diff --git a/servant/src/etc/servant.jpg b/servant/src/etc/servant.jpg
new file mode 100644
index 000000000..d7ea66267
Binary files /dev/null and b/servant/src/etc/servant.jpg differ
diff --git a/servant/src/etc/servant.svg b/servant/src/etc/servant.svg
new file mode 100644
index 000000000..c4891c79f
--- /dev/null
+++ b/servant/src/etc/servant.svg
@@ -0,0 +1,259 @@
+
+
+
diff --git a/servant/src/etc/servant.xml b/servant/src/etc/servant.xml
new file mode 100644
index 000000000..8da8a9e0b
--- /dev/null
+++ b/servant/src/etc/servant.xml
@@ -0,0 +1,638 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/servant/src/main/java/com/iluwatar/App.java b/servant/src/main/java/com/iluwatar/App.java
new file mode 100644
index 000000000..4571e2974
--- /dev/null
+++ b/servant/src/main/java/com/iluwatar/App.java
@@ -0,0 +1,53 @@
+package com.iluwatar;
+
+import java.util.ArrayList;
+
+
+/**
+ * Servant offers some functionality to a group of classes without defining that functionality in each of them.
+ * A Servant is a class whose instance provides methods that take care of a desired service,
+ * while objects for which the servant does something, are taken as parameters.
+ *
+ */
+public class App {
+ static Servant jenkins = new Servant("Jenkins");
+ static Servant travis = new Servant("Travis");
+
+ public static void main( String[] args ){
+ scenario(jenkins, 1);
+ scenario(travis, 0);
+ }
+
+ /*
+ * Can add a List with enum Actions for variable scenarios
+ * */
+ public static void scenario(Servant servant, int compliment){
+ King k = new King();
+ Queen q = new Queen();
+
+ ArrayList guests = new ArrayList<>();
+ guests.add(k);
+ guests.add(q);
+
+ //feed
+ servant.feed(k);
+ servant.feed(q);
+ //serve drinks
+ servant.giveWine(k);
+ servant.giveWine(q);
+ //compliment
+ servant.GiveCompliments( guests.get(compliment) );
+
+ //outcome of the night
+ for(Royalty r : guests)
+ r.changeMood();
+
+ //check your luck
+ if( servant.checkIfYouWillBeHanged(guests) )
+ System.out.println(servant.name + " will live another day");
+ else
+ System.out.println("Poor " + servant.name + ". His days are numbered");
+ }
+
+
+}
diff --git a/servant/src/main/java/com/iluwatar/King.java b/servant/src/main/java/com/iluwatar/King.java
new file mode 100644
index 000000000..7b38fd77f
--- /dev/null
+++ b/servant/src/main/java/com/iluwatar/King.java
@@ -0,0 +1,31 @@
+package com.iluwatar;
+
+public class King implements Royalty{
+ private boolean isDrunk = false, isHungry = true, isHappy = false;
+ private boolean complimentReceived = false;
+
+ @Override
+ public void getFed() {
+ isHungry = false;
+ }
+
+ @Override
+ public void getDrink() {
+ isDrunk = true;
+ }
+
+ public void receiveCompliments(){
+ complimentReceived = true;
+ }
+
+ @Override
+ public void changeMood() {
+ if(!isHungry && isDrunk) isHappy = true;
+ if( complimentReceived ) isHappy = false;
+ }
+
+ @Override
+ public boolean getMood() {
+ return isHappy;
+ }
+}
diff --git a/servant/src/main/java/com/iluwatar/Queen.java b/servant/src/main/java/com/iluwatar/Queen.java
new file mode 100644
index 000000000..baf6fd239
--- /dev/null
+++ b/servant/src/main/java/com/iluwatar/Queen.java
@@ -0,0 +1,35 @@
+package com.iluwatar;
+
+public class Queen implements Royalty{
+ private boolean isDrunk = true, isHungry = false, isHappy = false;
+ private boolean isFlirty = true, complimentReceived = false;
+
+ @Override
+ public void getFed() {
+ isHungry = false;
+ }
+
+ @Override
+ public void getDrink() {
+ isDrunk = true;
+ }
+
+ public void receiveCompliments(){
+ complimentReceived = true;
+ }
+
+ @Override
+ public void changeMood() {
+ if( complimentReceived && isFlirty && isDrunk ) isHappy = true;
+ }
+
+ @Override
+ public boolean getMood() {
+ return isHappy;
+ }
+
+ public void setFlirtiness(boolean f){
+ this.isFlirty = f;
+ }
+
+}
diff --git a/servant/src/main/java/com/iluwatar/Royalty.java b/servant/src/main/java/com/iluwatar/Royalty.java
new file mode 100644
index 000000000..2c8bef32d
--- /dev/null
+++ b/servant/src/main/java/com/iluwatar/Royalty.java
@@ -0,0 +1,9 @@
+package com.iluwatar;
+
+interface Royalty {
+ public void getFed();
+ public void getDrink();
+ public void changeMood();
+ public void receiveCompliments();
+ public boolean getMood();
+}
diff --git a/servant/src/main/java/com/iluwatar/Servant.java b/servant/src/main/java/com/iluwatar/Servant.java
new file mode 100644
index 000000000..599054e7a
--- /dev/null
+++ b/servant/src/main/java/com/iluwatar/Servant.java
@@ -0,0 +1,31 @@
+package com.iluwatar;
+
+import java.util.ArrayList;
+
+public class Servant {
+ public String name;
+
+ public Servant(String name){
+ this.name = name;
+ }
+
+ public void feed(Royalty r){
+ r.getFed();
+ }
+
+ public void giveWine(Royalty r){
+ r.getDrink();
+ }
+
+ public void GiveCompliments(Royalty r){
+ r.receiveCompliments();
+ }
+
+ public boolean checkIfYouWillBeHanged(ArrayList tableGuests){
+ boolean anotherDay = true;
+ for( Royalty r : tableGuests )
+ if( !r.getMood() ) anotherDay = false;
+
+ return anotherDay;
+ }
+}