diff --git a/src/main/java/org/fundacionjala/coding/Library.java b/src/main/java/org/fundacionjala/coding/Library.java
deleted file mode 100644
index 4543d94..0000000
--- a/src/main/java/org/fundacionjala/coding/Library.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package org.fundacionjala.coding;
-
-/**
- * This Java source file was auto generated by running 'gradle buildInit --type java-library'.
- */
-public class Library {
-
- /**
- * Some library method.
- *
- * @return true
- */
- public boolean someLibraryMethod() {
- return true;
- }
-}
diff --git a/src/main/java/org/fundacionjala/coding/danielcabero/averageofnumbers/AverageOfNumbers.java b/src/main/java/org/fundacionjala/coding/danielcabero/averageofnumbers/AverageOfNumbers.java
new file mode 100644
index 0000000..1378190
--- /dev/null
+++ b/src/main/java/org/fundacionjala/coding/danielcabero/averageofnumbers/AverageOfNumbers.java
@@ -0,0 +1,30 @@
+package org.fundacionjala.coding.danielcabero.averageofnumbers;
+
+import java.util.stream.IntStream;
+
+/**
+ * Created by administrator on 6/20/2017.
+ */
+
+public final class AverageOfNumbers {
+
+ /**
+ * Private constructor.
+ */
+ private AverageOfNumbers() {
+ }
+
+ /**
+ * The method returns the average of the elements in the array as a double array.
+ *
+ * @param numbers is an array of int numbers.
+ * @return the average of the numbers as an array.
+ */
+ public static double[] numberAverages(final int[] numbers) {
+ return (numbers == null || numbers.length <= 1)
+ ? new double[]{}
+ : IntStream.range(0, numbers.length - 1)
+ .mapToDouble(i -> (numbers[i] + numbers[i + 1]) / 2.0)
+ .toArray();
+ }
+}
diff --git a/src/main/java/org/fundacionjala/coding/danielcabero/bank_ocr/BankOcr.java b/src/main/java/org/fundacionjala/coding/danielcabero/bank_ocr/BankOcr.java
new file mode 100644
index 0000000..c7b72c8
--- /dev/null
+++ b/src/main/java/org/fundacionjala/coding/danielcabero/bank_ocr/BankOcr.java
@@ -0,0 +1,177 @@
+package org.fundacionjala.coding.danielcabero.bank_ocr;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Created by administrator on 3/10/2017.
+ */
+
+final class BankOcr {
+
+ private static final int MODULUS_FACTOR = 11;
+ private static final int ACCOUNT_LENGTH = 9;
+ private static final int SCANNED_ACCOUNT_LENGTH = 72;
+ private static final int MULTIPLY_FACTOR = 9;
+ private static final int INDEX_MODULUS_FACTOR = 9;
+ private static final int NUMBER_START = 0;
+ private static final int NUMBER_END = 3;
+ private static final Map MAPS_OF_NUMBERS = new HashMap<>();
+
+ static {
+ MAPS_OF_NUMBERS.put(NUMBERS.ZERO.ordinal(),
+ " _ "
+ + "| |"
+ + "|_|");
+ MAPS_OF_NUMBERS.put(NUMBERS.ONE.ordinal(),
+ " "
+ + " |"
+ + " |");
+ MAPS_OF_NUMBERS.put(NUMBERS.TWO.ordinal(),
+ " _ "
+ + " _|"
+ + "|_ ");
+ MAPS_OF_NUMBERS.put(NUMBERS.THREE.ordinal(),
+ "__ "
+ + " _|"
+ + "__|");
+ MAPS_OF_NUMBERS.put(NUMBERS.FOUR.ordinal(),
+ " "
+ + "|_|"
+ + " |");
+ MAPS_OF_NUMBERS.put(NUMBERS.FIVE.ordinal(),
+ " _ "
+ + "|_ "
+ + " _|");
+ MAPS_OF_NUMBERS.put(NUMBERS.SIX.ordinal(),
+ " _ "
+ + "|_ "
+ + "|_|");
+ MAPS_OF_NUMBERS.put(NUMBERS.SEVEN.ordinal(),
+ "__ "
+ + " |"
+ + " |");
+ MAPS_OF_NUMBERS.put(NUMBERS.EIGHT.ordinal(),
+ " _ "
+ + "|_|"
+ + "|_|");
+ MAPS_OF_NUMBERS.put(NUMBERS.NINE.ordinal(),
+ " _ "
+ + "|_|"
+ + " _|");
+ }
+
+ /**
+ * Constructor private.
+ */
+ private BankOcr() {
+
+ }
+
+ /**
+ * @param value used to obtain its int representation
+ * @return "?" if the value is not in range 0-9 otherwise
+ * return a number between 0 and 9.
+ */
+ private static String getKey(final String value) {
+ String key = "?";
+ for (Map.Entry entry : MAPS_OF_NUMBERS.entrySet()) {
+ if (entry.getValue().equals(value)) {
+ key = entry.getKey().toString();
+ }
+ }
+ return key;
+ }
+
+ /**
+ * This method determines if an scanned numberAccount is between the paraments corrects.
+ *
+ * @param numberAccount image of type String.
+ * @return true \\ false
+ */
+ private static boolean isCorrectLength(final String numberAccount) {
+ for (int i = 0; i < numberAccount.length(); i++) {
+ if (Character.isDigit(numberAccount.charAt(i))) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * This method validate if an account is correct or not.
+ *
+ * @param account String variable is the account to validate
+ * @return true if the passed account is true, false otherwise.
+ */
+ static boolean validateNumberAccount(final String account) {
+ int checksum = 0;
+ int multi = MULTIPLY_FACTOR;
+ for (char num : account.toString().toCharArray()) {
+ checksum += Integer.parseInt(String.valueOf(num)) * multi;
+ multi--;
+ }
+ return checksum % MODULUS_FACTOR == 0;
+ }
+
+ /**
+ * This method is in charge to give one of three posibilities errors to the numberAccountUser".
+ * "", "ERR" or "ILL"
+ *
+ * @param numberAccountUser String variable to determine its status.
+ * @return an String result with the values mentioned earlier.
+ */
+ static String getNumberAccount(final String numberAccountUser) {
+ String error = "";
+
+ if (!isCorrectLength(numberAccountUser)) {
+ error = "ILL";
+ } else if (!validateNumberAccount(numberAccountUser)) {
+ error = "ERR";
+ }
+ return error;
+ }
+
+ /**
+ * This method returns the string representation of the scanned image.
+ *
+ * @param scannedImage array string.
+ * @return String representation of scanned image.
+ */
+ static String numberAccountPresentImage(final String[] scannedImage) {
+ StringBuilder actPresent = new StringBuilder();
+
+ for (String number : scannedImage) {
+ actPresent.append(getKey(number));
+ }
+ return actPresent.toString();
+ }
+
+ /**
+ * This method validates if an scanned account has the correct digit
+ * numbers.
+ *
+ * @param scannedAccount of String type.
+ * @return true.
+ */
+ private static boolean sizeImageIsValid(final String scannedAccount) {
+ return scannedAccount.length() == SCANNED_ACCOUNT_LENGTH;
+ }
+
+ /**
+ * This enum type will contain the key values.
+ */
+ private enum NUMBERS {
+ ZERO(0), ONE(1), TWO(2), THREE(3),
+ FOUR(4), FIVE(5), SIX(6),
+ SEVEN(7), EIGHT(8), NINE(9);
+
+ /**
+ * Construct for Enum type.
+ *
+ * @param i of int type.
+ */
+ NUMBERS(final int i) {
+ }
+ }
+}
diff --git a/src/main/java/org/fundacionjala/coding/danielcabero/eanvalidator/EANValidator.java b/src/main/java/org/fundacionjala/coding/danielcabero/eanvalidator/EANValidator.java
new file mode 100644
index 0000000..529ca72
--- /dev/null
+++ b/src/main/java/org/fundacionjala/coding/danielcabero/eanvalidator/EANValidator.java
@@ -0,0 +1,54 @@
+package org.fundacionjala.coding.danielcabero.eanvalidator;
+
+/**
+ * Created administrat on 3/10/2017.
+ */
+
+final class EANValidator {
+ private static final int ODD_DIGIT_MULTIPLIER = 3;
+ private static final int DIVISIBILITY_FACTOR = 10;
+ private static final int EAN_CORRECTLY_LENGTH = 13;
+
+ /**
+ * Constructor private.
+ */
+
+ private EANValidator() {
+ }
+
+ /**
+ * Takes an string number to verify it is checksum it's correct.
+ *
+ * @param eAN String number with exactly 13 digits.
+ * @return true if the checksum is ok.
+ */
+
+ public static boolean validate(final String eAN) {
+ int sum = 0;
+
+ if (!checkCorrectLength(eAN)) {
+ return false;
+ } else {
+ for (int i = 1; i < eAN.length(); i++) {
+ int numericValue = Character.getNumericValue(eAN.charAt(i - 1));
+ sum += i % 2 == 0 ? numericValue * ODD_DIGIT_MULTIPLIER : numericValue;
+ }
+
+ int module = sum % DIVISIBILITY_FACTOR;
+ int check = module != 0 ? DIVISIBILITY_FACTOR - module : 0;
+
+ return check == Character.getNumericValue(eAN.charAt(eAN.length() - 1));
+ }
+ }
+
+ /**
+ * Takes an String number digits and returns true if the String length
+ * is exactly 13.
+ *
+ * @param stringNumber number
+ * @return true if stringNumber length is exactly 13.
+ */
+ public static boolean checkCorrectLength(final String stringNumber) {
+ return stringNumber.length() == EAN_CORRECTLY_LENGTH;
+ }
+}
diff --git a/src/main/java/org/fundacionjala/coding/danielcabero/evaporator/Evaporator.java b/src/main/java/org/fundacionjala/coding/danielcabero/evaporator/Evaporator.java
new file mode 100644
index 0000000..c4e8597
--- /dev/null
+++ b/src/main/java/org/fundacionjala/coding/danielcabero/evaporator/Evaporator.java
@@ -0,0 +1,34 @@
+package org.fundacionjala.coding.danielcabero.evaporator;
+
+/**
+ * Created by administrator on 06/26/2017.
+ */
+final class Evaporator {
+
+ private static final int PORCENT = 100;
+
+ /**
+ * Constructor.
+ */
+ private Evaporator() {
+ }
+
+ /**
+ * @param content of the gas in the tank.
+ * @param percentDay of loss in the day.
+ * @param threshold of gas loss that not use.
+ * @return days that save the gas.
+ */
+ static int evaporator(final double content, final double percentDay, final double threshold) {
+
+ int days = 0;
+ double contentPercentage = PORCENT;
+
+ while (contentPercentage > threshold) {
+ contentPercentage *= 1 - percentDay / PORCENT;
+ days++;
+ }
+
+ return days;
+ }
+}
diff --git a/src/main/java/org/fundacionjala/coding/danielcabero/highestandlowest/HighestAndLowest.java b/src/main/java/org/fundacionjala/coding/danielcabero/highestandlowest/HighestAndLowest.java
new file mode 100644
index 0000000..02b0e6b
--- /dev/null
+++ b/src/main/java/org/fundacionjala/coding/danielcabero/highestandlowest/HighestAndLowest.java
@@ -0,0 +1,33 @@
+package org.fundacionjala.coding.danielcabero.highestandlowest;
+
+import java.util.Arrays;
+import java.util.stream.Stream;
+
+/**
+ * Created by Administrator on 6/19/2017.
+ */
+
+final class HighestAndLowest {
+
+ /**
+ * Private constructor.
+ */
+ private HighestAndLowest() {
+ }
+
+ /**
+ * The method return the highest and lowest value of a number array.
+ *
+ * @param numbers is the String of numbers.
+ * @return a String with the highest and lowest values.
+ */
+ static String highAndLowest(final String numbers) {
+ int[] digits = Stream.of(numbers.split(" ")).mapToInt(Integer::parseInt).toArray();
+
+ int high = Arrays.stream(digits).max().getAsInt();
+
+ int lowest = Arrays.stream(digits).min().getAsInt();
+
+ return String.format("%d %d", high, lowest);
+ }
+}
diff --git a/src/main/java/org/fundacionjala/coding/danielcabero/movies/Children.java b/src/main/java/org/fundacionjala/coding/danielcabero/movies/Children.java
new file mode 100644
index 0000000..29774ec
--- /dev/null
+++ b/src/main/java/org/fundacionjala/coding/danielcabero/movies/Children.java
@@ -0,0 +1,32 @@
+package org.fundacionjala.coding.danielcabero.movies;
+
+/**
+ * Created by administrator on 3/10/2017.
+ */
+public class Children extends Movie {
+ private static final int CHILDREN_DAYS = 3;
+ private static final double PRICE = 1.5;
+
+ /**
+ * Children constructor.
+ *
+ * @param title of String type.
+ */
+ Children(final String title) {
+ super(title);
+ }
+
+ @Override
+ public double calculateAmount(final int daysRented) {
+ double amount = PRICE;
+ if (daysRented > CHILDREN_DAYS) {
+ amount += (daysRented - CHILDREN_DAYS) * PRICE;
+ }
+ return amount;
+ }
+
+ @Override
+ public int frequentPointsRenter(final int daysRented) {
+ return 1;
+ }
+}
diff --git a/src/main/java/org/fundacionjala/coding/danielcabero/movies/Customer.java b/src/main/java/org/fundacionjala/coding/danielcabero/movies/Customer.java
new file mode 100644
index 0000000..a18d4a3
--- /dev/null
+++ b/src/main/java/org/fundacionjala/coding/danielcabero/movies/Customer.java
@@ -0,0 +1,70 @@
+package org.fundacionjala.coding.danielcabero.movies;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by administrator on 3/10/2017.
+ */
+
+class Customer {
+ private String name;
+ private List rentalsList;
+
+ /**
+ * @param name String with words.
+ * Constructor.
+ */
+ Customer(final String name) {
+ this.name = name;
+ rentalsList = new ArrayList<>();
+ }
+
+ /**
+ * @param rental String with words.
+ */
+ void addRental(final Rental rental) {
+ rentalsList.add(rental);
+ }
+
+ /**
+ * @return the name string.
+ */
+ private String getName() {
+ return this.name;
+ }
+
+ /**
+ * @return the string.
+ */
+ String generateDetail() {
+ StringBuilder result = new StringBuilder();
+ result.append("Rental Record for ").append(getName()).append("\n");
+ for (Rental rental : rentalsList) {
+ result.append("\t").append(rental.getMovieTitle().getTitleMovie()).append("\t");
+ result.append("\t").append(rental.calculateAmount()).append("\t");
+ result.append("Days Rental ").append(rental.getDaysRent()).append("\n");
+ }
+ result.append("Amount owed is ").append(calculateTotalAmount()).append("\n");
+ result.append("You earned ").append(calculateTotalAmount()).append(" frequent renter points");
+ return result.toString();
+ }
+
+ /**
+ * This method calculates the total amount of the rented movies.
+ *
+ * @return the total amount.
+ */
+ private double calculateTotalAmount() {
+ return rentalsList.stream()
+ .mapToDouble(Rental::calculateAmount)
+ .sum();
+ }
+
+ /**
+ * @return the List of the c
+ */
+ List getRentalsList() {
+ return rentalsList;
+ }
+}
diff --git a/src/main/java/org/fundacionjala/coding/danielcabero/movies/Movie.java b/src/main/java/org/fundacionjala/coding/danielcabero/movies/Movie.java
new file mode 100644
index 0000000..32b4392
--- /dev/null
+++ b/src/main/java/org/fundacionjala/coding/danielcabero/movies/Movie.java
@@ -0,0 +1,43 @@
+package org.fundacionjala.coding.danielcabero.movies;
+
+/**
+ * Created by administrator on 3/10/2017.
+ */
+public abstract class Movie {
+ private String titleMovie;
+
+ /**
+ * Movie constructor.
+ *
+ * @param titleMovie of String type.
+ */
+ Movie(final String titleMovie) {
+ this.titleMovie = titleMovie;
+ }
+
+ /**
+ * Abstract method to calculate the amount of a rented movie.
+ *
+ * @param daysRented of int type.
+ * @return the amount of a rented movie.
+ */
+ public abstract double calculateAmount(int daysRented);
+
+ /**
+ * Abstract method to calculate the frequent renter points
+ * of a rented movie.
+ *
+ * @param daysRented of int type.
+ * @return the frequent renter points.
+ */
+ public abstract int frequentPointsRenter(int daysRented);
+
+ /**
+ * This method returns the titleMovie of a movie.
+ *
+ * @return the titleMovie of the movie.
+ */
+ String getTitleMovie() {
+ return titleMovie;
+ }
+}
diff --git a/src/main/java/org/fundacionjala/coding/danielcabero/movies/NewRelease.java b/src/main/java/org/fundacionjala/coding/danielcabero/movies/NewRelease.java
new file mode 100644
index 0000000..a9d2f78
--- /dev/null
+++ b/src/main/java/org/fundacionjala/coding/danielcabero/movies/NewRelease.java
@@ -0,0 +1,41 @@
+package org.fundacionjala.coding.danielcabero.movies;
+
+/**
+ * Created by administrator on 3/10/2017.
+ */
+public class NewRelease extends Movie {
+
+ private static final int NEW_RELEASE_DAYS = 3;
+
+ /**
+ * NewRelease constructor.
+ *
+ * @param title of type String.
+ */
+ NewRelease(final String title) {
+ super(title);
+ }
+
+ /**
+ * This method calculates the amount of a new release rented movie.
+ *
+ * @param daysRented of int type.
+ * @return the amount of a new release rented movie.
+ */
+ @Override
+ public double calculateAmount(final int daysRented) {
+ return daysRented * NEW_RELEASE_DAYS;
+ }
+
+ /**
+ * This method calculates the frequent renter points
+ * of a new release rented movie.
+ *
+ * @param daysRented of int type.
+ * @return 1 or 2.
+ */
+ @Override
+ public int frequentPointsRenter(final int daysRented) {
+ return daysRented > 1 ? 2 : 1;
+ }
+}
diff --git a/src/main/java/org/fundacionjala/coding/danielcabero/movies/Regular.java b/src/main/java/org/fundacionjala/coding/danielcabero/movies/Regular.java
new file mode 100644
index 0000000..c935878
--- /dev/null
+++ b/src/main/java/org/fundacionjala/coding/danielcabero/movies/Regular.java
@@ -0,0 +1,34 @@
+package org.fundacionjala.coding.danielcabero.movies;
+
+/**
+ * Created by administrator on 3/10/2017.
+ */
+public class Regular extends Movie {
+
+ private static final double PRICE_RENT = 1.5;
+
+ private static final int DAYS = 2;
+
+ /**
+ * Regular constructor.
+ *
+ * @param title of String type.
+ */
+ Regular(final String title) {
+ super(title);
+ }
+
+ @Override
+ public double calculateAmount(final int daysRented) {
+ double amount = DAYS;
+ if (daysRented > DAYS) {
+ amount += (daysRented - DAYS) * PRICE_RENT;
+ }
+ return amount;
+ }
+
+ @Override
+ public int frequentPointsRenter(final int daysRented) {
+ return 1;
+ }
+}
diff --git a/src/main/java/org/fundacionjala/coding/danielcabero/movies/Rental.java b/src/main/java/org/fundacionjala/coding/danielcabero/movies/Rental.java
new file mode 100644
index 0000000..11d20bb
--- /dev/null
+++ b/src/main/java/org/fundacionjala/coding/danielcabero/movies/Rental.java
@@ -0,0 +1,55 @@
+package org.fundacionjala.coding.danielcabero.movies;
+
+/**
+ * Created by administrator on 3/10/2017.
+ */
+
+class Rental {
+ private Movie movieTitle;
+ private int daysRent;
+
+ /**
+ * Rental movieTitle's constructor.
+ *
+ * @param movieTitle receives the movieTitle.
+ * @param daysRent receives the movieTitle's daysRent rented.
+ */
+ Rental(final Movie movieTitle, final int daysRent) {
+ this.movieTitle = movieTitle;
+ this.daysRent = daysRent;
+ }
+
+ /**
+ * Getter method to obtain daysRent a movies was rented.
+ *
+ * @return movies daysRent rented.
+ */
+ public int getDaysRent() {
+ return daysRent;
+ }
+
+ /**
+ * Getter method to obtain the movieTitle information.
+ *
+ * @return the movieTitle object.
+ */
+ Movie getMovieTitle() {
+ return movieTitle;
+ }
+
+ /**
+ * @return price object.
+ */
+ double calculateAmount() {
+ return movieTitle.calculateAmount(daysRent);
+ }
+
+ /**
+ * @return calculateFrequentRenterPoint int.
+ */
+ int calculateFrequentRenterPoint() {
+ return movieTitle.frequentPointsRenter(daysRent);
+ }
+
+
+}
diff --git a/src/main/java/org/fundacionjala/coding/danielcabero/multiplesof3and5/MultiplesOf3And5.java b/src/main/java/org/fundacionjala/coding/danielcabero/multiplesof3and5/MultiplesOf3And5.java
new file mode 100644
index 0000000..a29b9bf
--- /dev/null
+++ b/src/main/java/org/fundacionjala/coding/danielcabero/multiplesof3and5/MultiplesOf3And5.java
@@ -0,0 +1,32 @@
+package org.fundacionjala.coding.danielcabero.multiplesof3and5;
+
+/**
+ * Created by Administrator on 6/19/2017.
+ */
+
+public final class MultiplesOf3And5 {
+
+ private static final int THREE = 3;
+ private static final int FIVE = 5;
+
+ /**
+ * Constructor.
+ */
+ private MultiplesOf3And5() {
+ }
+
+ /**
+ * @param number for the calculate sum multiples of the 3 and 5.
+ * @return int sum the multiples between 3 and 5.
+ */
+ public static int solution(final int number) {
+ int sum = 0;
+
+ for (int i = 0; i < number; i++) {
+ if (i % THREE == 0 || i % FIVE == 0) {
+ sum += i;
+ }
+ }
+ return sum;
+ }
+}
diff --git a/src/main/java/org/fundacionjala/coding/danielcabero/sorttheinnercontent/SortInnerContent.java b/src/main/java/org/fundacionjala/coding/danielcabero/sorttheinnercontent/SortInnerContent.java
new file mode 100644
index 0000000..816a0e1
--- /dev/null
+++ b/src/main/java/org/fundacionjala/coding/danielcabero/sorttheinnercontent/SortInnerContent.java
@@ -0,0 +1,50 @@
+package org.fundacionjala.coding.danielcabero.sorttheinnercontent;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.stream.Collectors;
+
+/**
+ * Created by administrator on 6/20/2017.
+ */
+
+final class SortInnerContent {
+
+ private static final int LIMIT = 3;
+
+ /**
+ * Private Constructor.
+ */
+ private SortInnerContent() {
+ }
+
+ /**
+ * The method returns a new String with all the inner content of each one,
+ * sorted in a descending way.
+ *
+ * @param words of String type.
+ * @return all the words sorted in descending way joined by a space.
+ */
+ static String sortTheInnerContent(final String words) {
+ return Arrays.stream(words.split(" "))
+ .map(word -> word.length() < LIMIT ? word : sortWord(word))
+ .collect(Collectors.joining(" "));
+ }
+
+ /**
+ * The method reverse the inner content of a word.
+ *
+ * @param word of String type.
+ * @return the inner word sorted.
+ */
+ private static String sortWord(final String word) {
+ String[] characters = word.split("");
+ StringBuilder stringBuilder = new StringBuilder();
+ Arrays.sort(characters, 1, characters.length - 1,
+ Collections.reverseOrder());
+ for (String str : characters) {
+ stringBuilder.append(str);
+ }
+ return stringBuilder.toString();
+ }
+}
diff --git a/src/main/java/org/fundacionjala/coding/danielcabero/spinwords/SpinWords.java b/src/main/java/org/fundacionjala/coding/danielcabero/spinwords/SpinWords.java
new file mode 100644
index 0000000..0e63c0d
--- /dev/null
+++ b/src/main/java/org/fundacionjala/coding/danielcabero/spinwords/SpinWords.java
@@ -0,0 +1,31 @@
+package org.fundacionjala.coding.danielcabero.spinwords;
+
+import java.util.Arrays;
+import java.util.stream.Collectors;
+
+/**
+ * Created by administrator on 3/10/2017.
+ */
+
+final class SpinWords {
+
+ private static final int MINIMAL_WORD = 5;
+
+ /**
+ * Constructor private.
+ */
+ private SpinWords() {
+ }
+
+ /**
+ * @param text for the changes.
+ * @return String changes places.
+ */
+ public static String spinWords(final String text) {
+ return Arrays.stream(text.split(" "))
+ .map(word -> word.length() >= MINIMAL_WORD ? new StringBuilder(word).reverse() : word)
+ .collect(Collectors.joining(" "));
+ }
+
+
+}
diff --git a/src/test/java/org/fundacionjala/coding/LibraryTest.java b/src/test/java/org/fundacionjala/coding/LibraryTest.java
deleted file mode 100644
index b5115ea..0000000
--- a/src/test/java/org/fundacionjala/coding/LibraryTest.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.fundacionjala.coding;
-
-import org.junit.Test;
-
-import static org.junit.Assert.assertTrue;
-
-/**
- * Test for {@link Library}.
- */
-public class LibraryTest {
-
- /**
- * Verify some library method.
- */
- @Test
- public void testSomeLibraryMethod() {
- Library classUnderTest = new Library();
- assertTrue("someLibraryMethod should return 'true'", classUnderTest.someLibraryMethod());
- }
-}
diff --git a/src/test/java/org/fundacionjala/coding/danielcabero/averageofnumbers/AverageOfNumbersTest.java b/src/test/java/org/fundacionjala/coding/danielcabero/averageofnumbers/AverageOfNumbersTest.java
new file mode 100644
index 0000000..06c4a0b
--- /dev/null
+++ b/src/test/java/org/fundacionjala/coding/danielcabero/averageofnumbers/AverageOfNumbersTest.java
@@ -0,0 +1,114 @@
+package org.fundacionjala.coding.danielcabero.averageofnumbers;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Modifier;
+import java.util.Arrays;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Created by Administrator on 6/20/2017.
+ */
+public class AverageOfNumbersTest {
+ /**
+ * The method verifies test1.
+ */
+ @Test
+ public void test1() {
+ final int[] arrayNumbers = new int[]{2, 2, 2, 2, 2};
+
+ final double[] actualResult = AverageOfNumbers.numberAverages(arrayNumbers);
+
+ final double[] expectedResult = new double[]{2, 2, 2, 2};
+
+ assertEquals(Arrays.toString(expectedResult), Arrays.toString(actualResult));
+ }
+
+ /**
+ * The method verifies test2.
+ */
+ @Test
+ public void test2() {
+ final int[] arrayNumbers = new int[]{2, -2, 2, -2, 2};
+
+ final double[] actualResult = AverageOfNumbers.numberAverages(arrayNumbers);
+
+ final double[] expectedResult = new double[]{0, 0, 0, 0};
+
+ assertEquals(Arrays.toString(expectedResult), Arrays.toString(actualResult));
+ }
+
+
+ /**
+ * The method verifies test3.
+ */
+ @Test
+ public void test3() {
+
+ final int[] arrayNumbers = new int[]{1, 3, 5, 1, -10};
+
+ final double[] actualResult = AverageOfNumbers.numberAverages(arrayNumbers);
+
+ final double[] expectedResult = new double[]{2, 4, 3, -4.5};
+
+ assertEquals(Arrays.toString(expectedResult), Arrays.toString(actualResult));
+ }
+
+
+ /**
+ * The method verifies test4.
+ */
+ @Test
+ public void test4() {
+
+ final int[] arrayNumbers = new int[]{};
+
+ final double[] actualResult = AverageOfNumbers.numberAverages(arrayNumbers);
+
+ final double[] expectedResult = new double[]{};
+
+ assertEquals(Arrays.toString(expectedResult), Arrays.toString(actualResult));
+ }
+
+ /**
+ * The method verifies test5.
+ */
+ @Test
+ public void test5() {
+
+ final int[] arrayNumbers = new int[]{1};
+
+ final double[] actualResult = AverageOfNumbers.numberAverages(arrayNumbers);
+
+ final double[] expectedResult = new double[]{};
+
+ assertEquals(Arrays.toString(expectedResult), Arrays.toString(actualResult));
+ }
+
+ /**
+ * The method verifies test6.
+ */
+ @Test
+ public void test6() {
+ final int[] arrayNumbers = null;
+
+ final double[] actualResult = AverageOfNumbers.numberAverages(arrayNumbers);
+
+ final double[] expectedResult = new double[]{};
+
+ assertEquals(Arrays.toString(expectedResult), Arrays.toString(actualResult));
+ }
+
+ /**
+ *
+ * @throws Exception test constructor.
+ */
+ @Test
+ public void testConstructorIsPrivate() throws Exception {
+ Constructor constructor = AverageOfNumbers.class.getDeclaredConstructor();
+ assertTrue(Modifier.isPrivate(constructor.getModifiers()));
+ constructor.setAccessible(true);
+ constructor.newInstance();
+ }
+}
diff --git a/src/test/java/org/fundacionjala/coding/danielcabero/bank_ocr/BankOcrTest.java b/src/test/java/org/fundacionjala/coding/danielcabero/bank_ocr/BankOcrTest.java
new file mode 100644
index 0000000..05c8f43
--- /dev/null
+++ b/src/test/java/org/fundacionjala/coding/danielcabero/bank_ocr/BankOcrTest.java
@@ -0,0 +1,263 @@
+package org.fundacionjala.coding.danielcabero.bank_ocr;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Modifier;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Created by administrator on 3/10/2017.
+ */
+public class BankOcrTest {
+
+ /**
+ * Test if scanned image recognized numbers between 0 and 9.
+ */
+ @Test
+ public void testGetKeyWhenScannedNumbersAreBetween0And9() {
+ // given:
+ String[] scannedImage = {
+ " _ "
+ + "| |"
+ + "|_|",
+
+ " "
+ + " |"
+ + " |",
+
+ " _ "
+ + " _|"
+ + "|_ ",
+
+ "__ "
+ + " _|"
+ + "__|",
+
+ " "
+ + "|_|"
+ + " |",
+
+ " _ "
+ + "|_ "
+ + " _|",
+
+ " _ "
+ + "|_ "
+ + "|_|",
+
+ "__ "
+ + " |"
+ + " |",
+
+ " _ "
+ + "|_|"
+ + "|_|",
+
+ " _ "
+ + "|_|"
+ + " _|"
+ };
+
+ // when:
+ final String actualResult = BankOcr.numberAccountPresentImage(scannedImage);
+
+ // then:
+ final String expectedResult = "0123456789";
+ assertEquals(expectedResult, actualResult);
+ }
+
+ /**
+ * Test that anything different from a number is recognized as '?'.
+ */
+ @Test
+ public void testGetKeyWhenScannedImageHasDifferentValues() {
+ // given:
+ String[] scannedImage = {
+ " _ "
+ + "| |"
+ + "|_|",
+
+ " _ "
+ + "|_|"
+ + " _|",
+
+ "Wrong number",
+ "",
+ " _ "
+ + "|_ "
+ + " _|"
+ };
+
+ // when:
+ final String actualResult = BankOcr.numberAccountPresentImage(scannedImage);
+
+ // then:
+ final String expectedResult = "09??5";
+ assertEquals(expectedResult, actualResult);
+ }
+
+ /**
+ * Test if the scanned account is a correct one.
+ */
+ @Test
+ public void testValidateAccountWhenTheGivenAccountIsCorrect() {
+ // given:
+ final String[] scannedImage = {
+ "__ "
+ + " _|"
+ + "__|",
+
+ " "
+ + "|_|"
+ + " |",
+
+ " _ "
+ + "|_ "
+ + " _|",
+
+ " _ "
+ + "|_|"
+ + "|_|",
+
+ " _ "
+ + "|_|"
+ + "|_|",
+
+ " _ "
+ + " _|"
+ + "|_ ",
+
+ " _ "
+ + "|_|"
+ + "|_|",
+
+ " _ "
+ + "|_ "
+ + "|_|",
+
+ " _ "
+ + "|_ "
+ + " _|",
+ };
+ final String correctAccount = BankOcr.numberAccountPresentImage(scannedImage);
+
+ // when:
+ final boolean actualResult = BankOcr.validateNumberAccount(correctAccount);
+
+ // then:
+ assertTrue(actualResult);
+
+ }
+
+ /**
+ * Test if the scanned account is an incorrect one.
+ */
+ @Test
+ public void testValidateAccountWhenTheGivenAccountIsIncorrect() {
+ // given:
+ final String[] scannedImage = {
+ " "
+ + "|_|"
+ + " |",
+
+ " _ "
+ + "|_ "
+ + " _|",
+
+ " _ "
+ + "|_ "
+ + "|_|",
+
+ "__ "
+ + " |"
+ + " |",
+
+ };
+ final String incorrectAccount = BankOcr.numberAccountPresentImage(scannedImage);
+
+ // when:
+ final boolean actualResult = BankOcr.validateNumberAccount(incorrectAccount);
+
+ // then:
+ assertFalse(actualResult);
+ }
+
+ /**
+ * Test if the status of a correct account is "".
+ */
+ @Test
+ public void testGetAccountStatusWithACorrectAccount() {
+ // given:
+ final String correctAccount = "345882865";
+
+ // when:
+ final String actualResult = BankOcr.getNumberAccount(correctAccount);
+
+ // then:
+ final String expectResult = "ILL";
+ assertEquals(expectResult, actualResult);
+ }
+
+ /**
+ * Test if the status of an incorrect account is "ERR".
+ */
+ @Test
+ public void testGetAccountStatusWithAnIncorrectAccount() {
+ // given:
+ final String incorrectAccount = "1021453789";
+
+ // when:
+ final String actualResult = BankOcr.getNumberAccount(incorrectAccount);
+
+ // then:
+ final String expectedResult = "ILL";
+ assertEquals(expectedResult, actualResult);
+ }
+
+ /**
+ * Test if the status of an illegible account is: "ILL".
+ */
+ @Test
+ public void testGetAccountStatusWithAnIllegibleAccount() {
+ // given:
+ final String illegibleAccount = " 560 |";
+
+ // when:
+ final String actualResult = BankOcr.getNumberAccount(illegibleAccount);
+
+ // then:
+ final String expectedResult = "ILL";
+ assertEquals(expectedResult, actualResult);
+ }
+
+ /**
+ * Test if the status of an illegible account is: "ILL".
+ */
+ @Test
+ public void testGetAccountStatusWithAn() {
+ // given:
+ final String illegibleAccount = " 560 12 |";
+
+ // when:
+ final String actualResult = BankOcr.getNumberAccount(illegibleAccount);
+
+ // then:
+ final String expectedResult = "ILL";
+ assertEquals(expectedResult, actualResult);
+ }
+
+ /**
+ *
+ * @throws Exception test constructor.
+ */
+ @Test
+ public void testConstructorIsPrivate() throws Exception {
+ Constructor constructor = BankOcr.class.getDeclaredConstructor();
+ assertTrue(Modifier.isPrivate(constructor.getModifiers()));
+ constructor.setAccessible(true);
+ constructor.newInstance();
+ }
+
+}
diff --git a/src/test/java/org/fundacionjala/coding/danielcabero/eanvalidator/EANValidatorTest.java b/src/test/java/org/fundacionjala/coding/danielcabero/eanvalidator/EANValidatorTest.java
new file mode 100644
index 0000000..0909d8e
--- /dev/null
+++ b/src/test/java/org/fundacionjala/coding/danielcabero/eanvalidator/EANValidatorTest.java
@@ -0,0 +1,116 @@
+package org.fundacionjala.coding.danielcabero.eanvalidator;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Modifier;
+import org.junit.Test;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Created by administrator on 3/10/2017.
+ */
+public class EANValidatorTest {
+ /**
+ * Test when the EAN string number has exactly 13 digits.
+ */
+ @Test
+ public void testCheckLengthWhenTheEANStringNumberHasExactly13Digits() {
+ // given:
+ final String eanStringNumber = "4003301018398";
+
+ // when:
+ final boolean actualResult = EANValidator.checkCorrectLength(eanStringNumber);
+
+ // then:
+ assertTrue(actualResult);
+ }
+
+ /**
+ * Test when the EAN string number has less than 13 digits.
+ */
+ @Test
+ public void testCheckLengthWhenTheEANStringNumberHasLessThan13Digits() {
+ // given:
+ final String eanStringNumber = "400330101839";
+
+ // when:
+ final boolean actualResult = EANValidator.checkCorrectLength(eanStringNumber);
+
+ // then:
+ assertFalse(actualResult);
+ }
+
+ /**
+ * Test when the EAN string number has more than 13 digits.
+ */
+ @Test
+ public void testCheckLengthTheEANStringNumberHasMoreThan13Digits() {
+ // given:
+ final String eanStringNumber = "40033010183980";
+
+ // when:
+ final boolean actualResult = EANValidator.checkCorrectLength(eanStringNumber);
+
+ // then:
+ assertFalse(actualResult);
+ }
+
+ /**
+ * Test when the EAN string number checksum is different from 0.
+ */
+ @Test
+ public void testValidateTheCheckSumIsDifferentFromZero() {
+ // given:
+ final String eanStringNumber = "4003301018398";
+
+ // when:
+ final boolean actualResult = EANValidator.validate(eanStringNumber);
+
+ // then:
+ assertTrue(actualResult);
+ }
+
+ /**
+ * Test when the EAN string number checksum is equal to 0.
+ */
+ @Test
+ public void testValidateTheCheckSumIsEqualToZero() {
+ // given:
+ final String eanStringNumber = "4003301018392";
+
+ // when:
+ final boolean actualResult = EANValidator.validate(eanStringNumber);
+
+ // then:
+ assertTrue(!actualResult);
+ }
+
+ /**
+ *
+ * @throws Exception test constructor.
+ */
+ @Test
+ public void testConstructorIsPrivate() throws Exception {
+ Constructor constructor = EANValidator.class.getDeclaredConstructor();
+ assertTrue(Modifier.isPrivate(constructor.getModifiers()));
+ constructor.setAccessible(true);
+ constructor.newInstance();
+ }
+
+ /**
+ * Test when the EAN string number checksum is equal to 0.
+ */
+ @Test
+ public void testValidateTheCheckSumIsFalse() {
+ // given:
+ final String eanStringNumber = "s2343112";
+
+ // when:
+ final boolean actualResult = EANValidator.validate(eanStringNumber);
+
+ // then:
+ assertFalse(actualResult);
+ }
+
+}
+
diff --git a/src/test/java/org/fundacionjala/coding/danielcabero/evaporator/EvaporatorTest.java b/src/test/java/org/fundacionjala/coding/danielcabero/evaporator/EvaporatorTest.java
new file mode 100644
index 0000000..e08eff7
--- /dev/null
+++ b/src/test/java/org/fundacionjala/coding/danielcabero/evaporator/EvaporatorTest.java
@@ -0,0 +1,88 @@
+package org.fundacionjala.coding.danielcabero.evaporator;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Modifier;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Created by administrator on 28/06/2017.
+ */
+public class EvaporatorTest {
+ /**
+ * test 1.
+ */
+ @Test
+ public void testEvaporatorOne() {
+ assertEquals(22, Evaporator.evaporator(10, 10, 10));
+ }
+
+ /**
+ * test 2.
+ */
+ @Test
+ public void testEvaporatorTwo() {
+ assertEquals(29, Evaporator.evaporator(10, 10, 5));
+ }
+
+ /**
+ * test 3.
+ */
+ @Test
+ public void testEvaporatorThree() {
+ assertEquals(59, Evaporator.evaporator(100, 5, 5));
+ }
+
+ /**
+ * test 4.
+ */
+ @Test
+ public void testEvaporatorFour() {
+ assertEquals(37, Evaporator.evaporator(50, 12, 1));
+ }
+
+ /**
+ * test 5.
+ */
+ @Test
+ public void testEvaporatorFive() {
+ assertEquals(31, Evaporator.evaporator(47.5, 8, 8));
+ }
+
+ /**
+ * test 6.
+ */
+ @Test
+ public void testEvaporatorSix() {
+ assertEquals(459, Evaporator.evaporator(100, 1, 1));
+ }
+
+ /**
+ * test 7.
+ */
+ @Test
+ public void testEvaporatorSeven() {
+ assertEquals(459, Evaporator.evaporator(10, 1, 1));
+ }
+
+ /**
+ * test 8.
+ */
+ @Test
+ public void testEvaporatorEight() {
+ assertEquals(299, Evaporator.evaporator(100, 1, 5));
+ }
+
+ /**
+ *
+ * @throws Exception test constructor.
+ */
+ @Test
+ public void testConstructorIsPrivate() throws Exception {
+ Constructor constructor = Evaporator.class.getDeclaredConstructor();
+ assertTrue(Modifier.isPrivate(constructor.getModifiers()));
+ constructor.setAccessible(true);
+ constructor.newInstance();
+ }
+}
diff --git a/src/test/java/org/fundacionjala/coding/danielcabero/highestandlowest/HighestAndLowestTest.java b/src/test/java/org/fundacionjala/coding/danielcabero/highestandlowest/HighestAndLowestTest.java
new file mode 100644
index 0000000..5213091
--- /dev/null
+++ b/src/test/java/org/fundacionjala/coding/danielcabero/highestandlowest/HighestAndLowestTest.java
@@ -0,0 +1,181 @@
+package org.fundacionjala.coding.danielcabero.highestandlowest;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Modifier;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Created by Administrator on 6/19/2017.
+ */
+public class HighestAndLowestTest {
+
+ /**
+ * The method verifies test1.
+ */
+ @Test
+ public void test1() {
+ final String numbers = "1 2 3 4 5";
+
+ final String actualResult = HighestAndLowest.highAndLowest(numbers);
+
+ final String expectedResult = "5 1";
+
+ assertEquals(expectedResult, actualResult);
+ }
+
+ /**
+ * The method verifies test2.
+ */
+ @Test
+ public void test2() {
+ final String numbers = "1 2 -3 4 5";
+
+ final String actualResult = HighestAndLowest.highAndLowest(numbers);
+
+ final String expectedResult = "5 -3";
+
+ assertEquals(expectedResult, actualResult);
+ }
+
+
+ /**
+ * The method verifies test3.
+ */
+ @Test
+ public void test3() {
+ final String numbers = "1 9 3 4 -5";
+
+ final String actualResult = HighestAndLowest.highAndLowest(numbers);
+
+ final String expectedResult = "9 -5";
+
+ assertEquals(expectedResult, actualResult);
+ }
+
+ /**
+ * The method verifies test4.
+ */
+ @Test
+ public void test4() {
+ final String numbers = "4 5 29 54 4 0 -214 542 -64 1 -3 6 -6";
+
+ final String actualResult = HighestAndLowest.highAndLowest(numbers);
+
+ final String expectedResult = "542 -214";
+
+ assertEquals(expectedResult, actualResult);
+ }
+
+ /**
+ * The method verifies test5.
+ */
+ @Test
+ public void test5() {
+ final String numbers = "1 -1";
+
+ final String actualResult = HighestAndLowest.highAndLowest(numbers);
+
+ final String expectedResult = "1 -1";
+
+ assertEquals(expectedResult, actualResult);
+ }
+
+ /**
+ * The method verifies test6.
+ */
+ @Test
+ public void test6() {
+ final String numbers = "1 1";
+
+ final String actualResult = HighestAndLowest.highAndLowest(numbers);
+
+ final String expectedResult = "1 1";
+
+ assertEquals(expectedResult, actualResult);
+ }
+
+ /**
+ * The method verifies test7.
+ */
+ @Test
+ public void test7() {
+ final String numbers = "-1 -1";
+
+ final String actualResult = HighestAndLowest.highAndLowest(numbers);
+
+ final String expectedResult = "-1 -1";
+
+ assertEquals(expectedResult, actualResult);
+ }
+
+ /**
+ * The method verifies test8.
+ */
+ @Test
+ public void test8() {
+ final String numbers = "1 -1 0";
+
+ final String actualResult = HighestAndLowest.highAndLowest(numbers);
+
+ final String expectedResult = "1 -1";
+
+ assertEquals(expectedResult, actualResult);
+ }
+
+ /**
+ * The method verifies test9.
+ */
+ @Test
+ public void test9() {
+ final String numbers = "1 1 0";
+
+ final String actualResult = HighestAndLowest.highAndLowest(numbers);
+
+ final String expectedResult = "1 0";
+
+ assertEquals(expectedResult, actualResult);
+ }
+
+ /**
+ * The method verifies test10.
+ */
+ @Test
+ public void test10() {
+ final String numbers = "-1 -1 0";
+
+ final String actualResult = HighestAndLowest.highAndLowest(numbers);
+
+ final String expectedResult = "0 -1";
+
+ assertEquals(expectedResult, actualResult);
+ }
+
+ /**
+ * The method verifies test11.
+ */
+ @Test
+ public void test11() {
+ final String numbers = "42";
+
+ final String actualResult = HighestAndLowest.highAndLowest(numbers);
+
+ final String expectedResult = "42 42";
+
+ assertEquals(expectedResult, actualResult);
+ }
+
+ /**
+ *
+ * @throws Exception test constructor.
+ */
+ @Test
+ public void testConstructorIsPrivate() throws Exception {
+ Constructor constructor = HighestAndLowest.class.getDeclaredConstructor();
+ assertTrue(Modifier.isPrivate(constructor.getModifiers()));
+ constructor.setAccessible(true);
+ constructor.newInstance();
+ }
+
+}
diff --git a/src/test/java/org/fundacionjala/coding/danielcabero/movies/ChildrenTest.java b/src/test/java/org/fundacionjala/coding/danielcabero/movies/ChildrenTest.java
new file mode 100644
index 0000000..361e11c
--- /dev/null
+++ b/src/test/java/org/fundacionjala/coding/danielcabero/movies/ChildrenTest.java
@@ -0,0 +1,80 @@
+package org.fundacionjala.coding.danielcabero.movies;
+
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Created by administrator on 3/10/2017.
+ */
+public class ChildrenTest {
+ /**
+ * Test to verify the amount if the rented days
+ * for a Children movie is less than 3 e.g. 1
+ */
+ @Test
+ public void testCalculateAmountWhenTheRentedDaysIsLessThanThree() {
+ // given:
+ Children childrenInstance = new Children("Test");
+
+ // when:
+ final double actualResult = childrenInstance.calculateAmount(1);
+
+ // then
+ final double expectedResult = 1.5;
+ assertEquals(expectedResult, actualResult, 0);
+ }
+
+ /**
+ * Test to verify the amount if the rented days
+ * for a Children movie is greater than 3 e.g. 10
+ */
+ @Test
+ public void testCalculateAmountWhenTheRentedDaysIsGreaterThanThree() {
+ // given:
+ Children childrenInstance = new Children("Test");
+
+ // when:
+ final double actualResult = childrenInstance.calculateAmount(10);
+
+ // then:
+ final double expectedResult = 10.5;
+ assertEquals(expectedResult, 0, actualResult);
+ }
+
+ /**
+ * Test to verify the frequent renter points for a Children movie
+ * is 1 for different rented days.
+ */
+ @Test
+ public void testCalculateFrequentRenterPointsVerifyTheResultIsOne() {
+ // given:
+ Children childrenInstance = new Children("Test");
+
+ // when:
+ final int actualResultOne = childrenInstance.frequentPointsRenter(1);
+
+ // then:
+ final int expectedResultOne = 1;
+ assertEquals(expectedResultOne, actualResultOne);
+
+ // given: childrenInstance
+
+ // when:
+ final int actualResultTwo = childrenInstance.frequentPointsRenter(3);
+
+ // then:
+ final int expectedResultTwo = 1;
+ assertEquals(expectedResultTwo, actualResultTwo);
+
+ // give: childrenInstance
+
+ // when:
+ final int actualResultThree = childrenInstance.frequentPointsRenter(1000);
+
+ // then:
+ final int expectedResultThree = 1;
+ assertEquals(actualResultThree, expectedResultThree);
+ }
+
+}
diff --git a/src/test/java/org/fundacionjala/coding/danielcabero/movies/CustomerTest.java b/src/test/java/org/fundacionjala/coding/danielcabero/movies/CustomerTest.java
new file mode 100644
index 0000000..4337d89
--- /dev/null
+++ b/src/test/java/org/fundacionjala/coding/danielcabero/movies/CustomerTest.java
@@ -0,0 +1,69 @@
+package org.fundacionjala.coding.danielcabero.movies;
+
+import java.util.List;
+import java.util.ArrayList;
+
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Created by Administrator on 7/5/2017.
+ */
+public class CustomerTest {
+
+ /**
+ * test 1.
+ */
+ @Test
+ public void testRentalEmpty() {
+ //Given
+ Customer customer = new Customer("Test");
+ // when:
+ final List actualResult = customer.getRentalsList();
+
+ // then:
+ final List expectedResult = new ArrayList();
+ assertEquals(expectedResult, actualResult);
+ }
+
+ /**
+ * test 2.
+ */
+ @Test
+ public void testRental() {
+ // given:
+ Customer customer = new Customer("Test");
+ // when:
+ final String actualResult = customer.generateDetail();
+ String expected = "Rental Record for Test\n"
+ + "Amount owed is 0.0\n"
+ + "You earned 0.0 frequent renter points";
+ // then:
+ assertEquals(expected, actualResult);
+ }
+
+ /**
+ * Test Release and Regular.
+ */
+ @Test
+ public void testReleaseAndRegular() {
+ // given
+ Customer customer = new Customer("test");
+ customer.addRental(new Rental(new NewRelease("Scary movie"), 2));
+ customer.addRental(new Rental(new Regular("Star wars"), 1));
+
+ // when
+ final String actualResult = customer.generateDetail();
+
+ // then
+ final String expectedResult = "Rental Record for test\n"
+ + "\tScary movie\t\t6.0\tDays Rental 2\n"
+ + "\tStar wars\t\t2.0\tDays Rental 1\n"
+ + "Amount owed is 8.0\n"
+ + "You earned 8.0 frequent renter points";
+ assertEquals(actualResult, expectedResult);
+ }
+
+
+}
diff --git a/src/test/java/org/fundacionjala/coding/danielcabero/movies/NewReleaseTest.java b/src/test/java/org/fundacionjala/coding/danielcabero/movies/NewReleaseTest.java
new file mode 100644
index 0000000..35504d2
--- /dev/null
+++ b/src/test/java/org/fundacionjala/coding/danielcabero/movies/NewReleaseTest.java
@@ -0,0 +1,81 @@
+package org.fundacionjala.coding.danielcabero.movies;
+
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Created by administrator on 3/10/2017.
+ */
+public class NewReleaseTest {
+
+ /**
+ * Test to verify the amount if the rented days
+ * for a NewRelease movie is less than 3 e.g. 1
+ */
+ @Test
+ public void testCalculateAmountWhenTheRentedDaysIsLessThanThree() {
+ // given:
+ NewRelease newReleaseInstance = new NewRelease("Test");
+
+ // when:
+ final double actualResult = newReleaseInstance.calculateAmount(1);
+
+ // then
+ final double expectedResult = 3;
+ assertEquals(expectedResult, actualResult, 0);
+ }
+
+ /**
+ * Test to verify the amount if the rented days
+ * for a NewRelease movie is greater than 3 e.g. 10
+ */
+ @Test
+ public void testCalculateAmountWhenTheRentedDaysIsGreaterThanThree() {
+ // given:
+ NewRelease newReleaseInstance = new NewRelease("Test");
+
+ // when:
+ final double actualResult = newReleaseInstance.calculateAmount(10);
+
+ // then:
+ final double expectedResult = 30;
+ assertEquals(expectedResult, actualResult, 0);
+ }
+
+ /**
+ * Test to verify the frequent renter points for a NewRelease movie
+ * is 1 for different rented days.
+ */
+ @Test
+ public void testCalculateFrequentRenterPointsVerifyTheResultIsOne() {
+ // given:
+ NewRelease newReleaseInstance = new NewRelease("Test");
+
+ // when:
+ final int actualResultOne = newReleaseInstance.frequentPointsRenter(1);
+
+ // then:
+ final int expectedResultOne = 1;
+ assertEquals(expectedResultOne, actualResultOne);
+
+ // given: newReleaseInstance
+
+ // when:
+ final int actualResultTwo = newReleaseInstance.frequentPointsRenter(3);
+
+ // then:
+ final int expectedResultTwo = 2;
+ assertEquals(expectedResultTwo, actualResultTwo);
+
+ // give:
+
+ // when:
+ final int actualResultThree = newReleaseInstance.frequentPointsRenter(1000);
+
+ // then:
+ final int expectedResultThree = 2;
+ assertEquals(actualResultThree, expectedResultThree);
+ }
+
+}
diff --git a/src/test/java/org/fundacionjala/coding/danielcabero/movies/RegularTest.java b/src/test/java/org/fundacionjala/coding/danielcabero/movies/RegularTest.java
new file mode 100644
index 0000000..1d3eb52
--- /dev/null
+++ b/src/test/java/org/fundacionjala/coding/danielcabero/movies/RegularTest.java
@@ -0,0 +1,81 @@
+package org.fundacionjala.coding.danielcabero.movies;
+
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Created by administrator on 3/10/2017.
+ */
+public class RegularTest {
+
+ /**
+ * Test to verify the amount if the rented days
+ * for a Regular movie is less than 2 e.g. 1
+ */
+ @Test
+ public void testCalculateAmountWhenTheRentedDaysIsLessThanThree() {
+ // given:
+ Regular regularInstance = new Regular("Test");
+
+ // when:
+ final double actualResult = regularInstance.calculateAmount(1);
+
+ // then
+ final double expectedResult = 2;
+ assertEquals(expectedResult, actualResult, 0);
+ }
+
+ /**
+ * Test to verify the amount if the rented days
+ * for a Regular movie is greater than 2 e.g. 10
+ */
+ @Test
+ public void testCalculateAmountWhenTheRentedDaysIsGreaterThanThree() {
+ // given:
+ Regular regularInstance = new Regular("Test");
+
+ // when:
+ final double actualResult = regularInstance.calculateAmount(10);
+
+ // then:
+ final double expectedResult = 14;
+ assertEquals(expectedResult, actualResult, 0);
+ }
+
+ /**
+ * Test to verify the frequent renter points for a Regular movie
+ * is 1 for different rented days.
+ */
+ @Test
+ public void testCalculateFrequentRenterPointsVerifyTheResultIsOne() {
+ // given:
+ Regular regularInstance = new Regular("Test");
+
+ // when:
+ final int actualResultOne = regularInstance.frequentPointsRenter(1);
+
+ // then:
+ final int expectedResultOne = 1;
+ assertEquals(expectedResultOne, actualResultOne);
+
+ // given: regularInstance
+
+ // when:
+ final int actualResultTwo = regularInstance.frequentPointsRenter(3);
+
+ // then:
+ final int expectedResultTwo = 1;
+ assertEquals(expectedResultTwo, actualResultTwo);
+
+ // give: regularInstance
+
+ // when:
+ final int actualResultThree = regularInstance.frequentPointsRenter(1000);
+
+ // then:
+ final int expectedResultThree = 1;
+ assertEquals(actualResultThree, expectedResultThree);
+ }
+
+}
diff --git a/src/test/java/org/fundacionjala/coding/danielcabero/movies/RentalTest.java b/src/test/java/org/fundacionjala/coding/danielcabero/movies/RentalTest.java
new file mode 100644
index 0000000..a84e09b
--- /dev/null
+++ b/src/test/java/org/fundacionjala/coding/danielcabero/movies/RentalTest.java
@@ -0,0 +1,64 @@
+package org.fundacionjala.coding.danielcabero.movies;
+
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Created by Administrator on 7/5/2017.
+ */
+public class RentalTest {
+
+ private Movie movie = new Movie("test") {
+ @Override
+ public double calculateAmount(final int daysRented) {
+ return 2;
+ }
+
+ @Override
+ public int frequentPointsRenter(final int daysRented) {
+ return 2;
+ }
+ };
+
+ /**
+ * test gatDays.
+ */
+ @Test
+ public void getDaysRent() {
+ //given
+ Rental rental = new Rental(movie, 2);
+
+ //when
+ final int days = 2;
+
+ //then
+ assertEquals(rental.getDaysRent(), days);
+ }
+
+ /**
+ * test get movie.
+ */
+ @Test
+ public void getMovieTitle() {
+ //when
+ Rental rental = new Rental(movie, 3);
+
+ //Then
+ assertEquals(movie, rental.getMovieTitle());
+ }
+
+ /**
+ * test get movie.
+ */
+ @Test
+ public void getMovieFrequentPoints() {
+ //when
+ Rental rental = new Rental(movie, 3);
+ final int expected = 2;
+ //Then
+ assertEquals(expected, rental.calculateFrequentRenterPoint());
+ }
+
+
+}
diff --git a/src/test/java/org/fundacionjala/coding/danielcabero/multiplesof3and5/MultiplesOf3And5Test.java b/src/test/java/org/fundacionjala/coding/danielcabero/multiplesof3and5/MultiplesOf3And5Test.java
new file mode 100644
index 0000000..085b13d
--- /dev/null
+++ b/src/test/java/org/fundacionjala/coding/danielcabero/multiplesof3and5/MultiplesOf3And5Test.java
@@ -0,0 +1,66 @@
+package org.fundacionjala.coding.danielcabero.multiplesof3and5;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Modifier;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Created by Administrator on 6/19/2017.
+ */
+public class MultiplesOf3And5Test {
+
+ /**
+ * The method verifies test1.
+ */
+ @Test
+ public void testGetSolutionWhenNumberPassedIs10() {
+ final int numberLimit = 10;
+
+ final int actualResult = MultiplesOf3And5.solution(numberLimit);
+
+ final int expectedResult = 23;
+
+ assertEquals(expectedResult, actualResult);
+ }
+
+ /**
+ * The method verifies test2.
+ */
+ @Test
+ public void testGetSolutionWhenNumberPassedIs20() {
+ final int numberLimit = 20;
+
+ final int actualResult = MultiplesOf3And5.solution(numberLimit);
+
+ final int expectedResult = 78;
+
+ assertEquals(expectedResult, actualResult);
+ }
+
+ /**
+ * The method verifies test3.
+ */
+ @Test
+ public void testGetSolutionWhenNumberPassedIs200() {
+ final int numberLimit = 200;
+
+ final int actualResult = MultiplesOf3And5.solution(numberLimit);
+
+ final int expectedResult = 9168;
+
+ assertEquals(expectedResult, actualResult);
+ }
+
+ /**
+ * @throws Exception for the constructor.
+ */
+ @Test
+ public void testConstructorIsPrivate() throws Exception {
+ Constructor constructor = MultiplesOf3And5.class.getDeclaredConstructor();
+ assertTrue(Modifier.isPrivate(constructor.getModifiers()));
+ constructor.setAccessible(true);
+ constructor.newInstance();
+ }
+}
diff --git a/src/test/java/org/fundacionjala/coding/danielcabero/sorttheinnercontent/SortInnerContentTest.java b/src/test/java/org/fundacionjala/coding/danielcabero/sorttheinnercontent/SortInnerContentTest.java
new file mode 100644
index 0000000..7ff895a
--- /dev/null
+++ b/src/test/java/org/fundacionjala/coding/danielcabero/sorttheinnercontent/SortInnerContentTest.java
@@ -0,0 +1,66 @@
+package org.fundacionjala.coding.danielcabero.sorttheinnercontent;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Modifier;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Created by Administrator on 6/20/2017.
+ */
+public class SortInnerContentTest {
+ /**
+ * The method verifies test1.
+ */
+ @Test
+ public void test1() {
+ String phrase = "sort the inner content in descending order";
+
+ String actualResult = SortInnerContent.sortTheInnerContent(phrase);
+
+ String expectedResult = "srot the inner ctonnet in dsnnieedcg oredr";
+
+ assertEquals(expectedResult, actualResult);
+ }
+
+ /**
+ * The method verifies test2.
+ */
+ @Test
+ public void test2() {
+ String phrase = "wait for me";
+
+ String actualResult = SortInnerContent.sortTheInnerContent(phrase);
+
+ String expectedResult = "wiat for me";
+
+ assertEquals(expectedResult, actualResult);
+ }
+
+ /**
+ * The method verifies test3.
+ */
+ @Test
+ public void test3() {
+ String phrase = "this kata is easy";
+
+ String actualResult = SortInnerContent.sortTheInnerContent(phrase);
+
+ String expectedResult = "tihs ktaa is esay";
+
+ assertEquals(expectedResult, actualResult);
+ }
+
+ /**
+ *
+ * @throws Exception for test constructor.
+ */
+ @Test
+ public void testConstructorIsPrivate() throws Exception {
+ Constructor constructor = SortInnerContent.class.getDeclaredConstructor();
+ assertTrue(Modifier.isPrivate(constructor.getModifiers()));
+ constructor.setAccessible(true);
+ constructor.newInstance();
+ }
+}
diff --git a/src/test/java/org/fundacionjala/coding/danielcabero/spinwords/SpinWordsTest.java b/src/test/java/org/fundacionjala/coding/danielcabero/spinwords/SpinWordsTest.java
new file mode 100644
index 0000000..88389fd
--- /dev/null
+++ b/src/test/java/org/fundacionjala/coding/danielcabero/spinwords/SpinWordsTest.java
@@ -0,0 +1,83 @@
+package org.fundacionjala.coding.danielcabero.spinwords;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Modifier;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Created by administrator on 3/10/2017.
+ */
+public class SpinWordsTest {
+ /**
+ * Test when sentence has words with more than 5 characters.
+ */
+ @Test
+ //test + method_to_test + scenario
+ public void testSpinWordsWhenSentenceHasWordsWithMoreThanFiveCharacters() {
+ // given: (preconditions)
+ final String message = "Hey fellow warriors";
+
+ // when: (method_to_test)
+ final String actualResult = SpinWords.spinWords(message);
+
+ // then: (what you expect)
+ final String expectedResult = "Hey wollef sroirraw";
+ assertEquals(expectedResult, actualResult);
+ }
+
+ /**
+ * Test when sentence doesn't have words with more than 5 characters.
+ */
+ @Test
+ public void testSpinWordsWhenSentenceDoesNotHaveWordsWithMoreThanFiveCharacters() {
+ final String message = "This is a test";
+
+ final String actualResult = SpinWords.spinWords(message);
+
+ final String expectedResult = "This is a test";
+
+ assertEquals(expectedResult, actualResult);
+ }
+
+ /**
+ * Test when sentence has words with 5 characters.
+ */
+ @Test
+ public void testSpinWordsWhenSentenceHasWordsWithFiveCharacters() {
+ final String message = "This is a table";
+
+ final String actualResult = SpinWords.spinWords(message);
+
+ final String expectedResult = "This is a elbat";
+
+ assertEquals(expectedResult, actualResult);
+ }
+
+ /**
+ * Test when sentence has one just word.
+ */
+ @Test
+ public void testSpinWordsWhenSentenceHasOneWord() {
+ final String message = "Welcome";
+
+ final String actualResult = SpinWords.spinWords(message);
+
+ final String expectedResult = "emocleW";
+
+ assertEquals(expectedResult, actualResult);
+ }
+
+ /**
+ *
+ * @throws Exception for test constructor.
+ */
+ @Test
+ public void testConstructorIsPrivate() throws Exception {
+ Constructor constructor = SpinWords.class.getDeclaredConstructor();
+ assertTrue(Modifier.isPrivate(constructor.getModifiers()));
+ constructor.setAccessible(true);
+ constructor.newInstance();
+ }
+}