diff --git a/.idea/.name b/.idea/.name
new file mode 100644
index 0000000..1f58a0f
--- /dev/null
+++ b/.idea/.name
@@ -0,0 +1 @@
+generics
\ No newline at end of file
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
new file mode 100644
index 0000000..c20d346
--- /dev/null
+++ b/.idea/compiler.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__junit_junit_4_12.xml b/.idea/libraries/Maven__junit_junit_4_12.xml
new file mode 100644
index 0000000..d411041
--- /dev/null
+++ b/.idea/libraries/Maven__junit_junit_4_12.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml
new file mode 100644
index 0000000..f58bbc1
--- /dev/null
+++ b/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..d30d09e
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..ca63f44
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100644
index 0000000..855fade
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,617 @@
+
+
+
+
+
+
+
+
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1.8
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/generics.iml b/generics.iml
new file mode 100644
index 0000000..9717c26
--- /dev/null
+++ b/generics.iml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/.deleteme b/src/main/java/.deleteme
deleted file mode 100644
index e69de29..0000000
diff --git a/src/main/java/MyArrayList.java b/src/main/java/MyArrayList.java
new file mode 100644
index 0000000..e480c67
--- /dev/null
+++ b/src/main/java/MyArrayList.java
@@ -0,0 +1,134 @@
+import java.util.Arrays;
+
+public class MyArrayList {
+
+ private int arraySize;
+ private int currentIndex = 0;
+ protected T[] myArrayList;
+
+ public MyArrayList() {
+ this.myArrayList = (T[]) new Object[0];
+
+ }
+
+ public MyArrayList(int arraySize) {
+
+ this.myArrayList = (T[]) new Object[arraySize];
+
+ }
+
+ public void add(T elementToAdd) {
+ if(myArrayList.length-this.size()<5){
+ this.ensureCapacity();
+ }
+ myArrayList[currentIndex]=elementToAdd;
+ currentIndex++;
+ }
+
+ public void add(int index, T elementToAdd) {
+ if (myArrayList[index] == (null)) {
+ myArrayList[index] = elementToAdd;
+ } else {
+ if(this.myArrayList.length-size()<5){
+ this.ensureCapacity();
+ }
+ int counter = currentIndex;
+ while (index < counter) {
+ myArrayList[counter] = myArrayList[counter-1];
+ counter--;
+ }
+ myArrayList[index]=elementToAdd;
+ }
+ currentIndex++;
+ }
+ public void addAll(T[] arrayOfElementsToAdd){
+ this.myArrayList = Arrays.copyOf(this.myArrayList,this.size()+arrayOfElementsToAdd.length);
+ System.arraycopy(arrayOfElementsToAdd,0,myArrayList,this.size(),arrayOfElementsToAdd.length);
+ currentIndex+=arrayOfElementsToAdd.length;
+ }
+
+ public void remove(int index) {
+ if (index < size()) {
+ myArrayList[index] = null;
+ reSize(index);
+ } else throw new ArrayIndexOutOfBoundsException();
+ }
+ public void remove(T elementToRemove){
+ for(int i=0;i {
+
+ //private T[] mySet;
+ private MyArrayList mySet;
+
+ public MySet () {
+ this.mySet = new MyArrayList();
+ }
+
+// public MySet(int size){
+// //this.mySet = (T[]) new MyArrayList[size];
+// }
+
+ public boolean add(T element){
+ if(!mySet.contains(element)) {
+ if (mySet.size() < 5) {
+ mySet.ensureCapacity();
+ }
+ mySet.add(element);
+ return true;
+ }
+ return false;
+
+ }
+
+ public boolean add(int index, T element){
+ if(!mySet.contains(element)){
+ if(mySet.size()<5){
+ mySet.ensureCapacity();
+ }
+ mySet.add(index,element);
+ return true;
+ }
+ return false;
+ }
+
+ public boolean remove(int index){
+ Object temp = mySet.get(index);
+ mySet.remove(index);
+ if(mySet.contains(temp)){
+ return false;
+ }
+ return true;
+ }
+
+ public boolean remove(T elementToBeRemoved){
+ if(mySet.contains(elementToBeRemoved)){
+ mySet.remove(elementToBeRemoved);
+ return true;
+ }
+ return false;
+ }
+ public boolean contains(T element){
+
+ return mySet.contains(element);
+ }
+
+ public T get(int index){
+ for(int i=0;i test = new MyArrayList<>();
+ Integer elementToAdd = 10;
+ test.add(elementToAdd);
+
+ Integer expected = 1;
+ Integer actual = test.size();
+
+ Assert.assertEquals(expected,actual);
+ }
+ @Test
+ public void testAddAtIndex(){
+ MyArrayList test = new MyArrayList<>();
+ test.add("Hey Bo, Jess");
+ test.add("Tomorrow");
+ test.add("is");
+ test.add("only");
+ test.add("Found");
+ test.add("In");
+ test.add("Calander");
+ test.add("of");
+ test.add("Fools");
+ test.add("Get Back To Work");
+
+ test.add(6,"The");
+
+ String expected = "The";
+ String actual = test.get(6);
+
+ Assert.assertEquals(expected,actual);
+ }
+ @Test
+ public void testAddAll1(){
+ MyArrayListtest = new MyArrayList<>();
+ test.add(10);
+ test.add(33);
+ test.add(40);
+ Integer[] arrayOfElementsToAdd = {50,25,4,77};
+
+ test.addAll(arrayOfElementsToAdd);
+
+ Integer expected = 7;
+ Integer actual = test.size();
+ Assert.assertEquals(expected,actual);
+
+ }
+ @Test
+ public void testAddAll2(){
+ MyArrayList test = new MyArrayList<>();
+
+ String[] expected = {"Joshua","Luis","Kibret"};
+ test.addAll(expected);
+ String[]actual = test.toArray(new String[0]);
+
+ }
+
+ @Test
+ public void testRemove() {
+ MyArrayListtest =new MyArrayList<>();
+ test.add(2.0);
+ test.add(4.75);
+ test.remove(0);
+ }
+
+ @Test
+ public void testRetIndex1() {
+ MyArrayList test = new MyArrayList<>();
+ test.add(new Integer(1));
+ test.add(new Integer(2));
+ test.add(new Integer(3));
+
+ Integer expected = 3;
+ Integer actual =test.get(2);
+
+ Assert.assertEquals(expected,actual);
+ }
+
+ @Test
+ public void testGetIndex2(){
+ MyArrayList test = new MyArrayList<>();
+ test.add("Hey Joe");
+ test.add("Tomorrow");
+ test.add("is");
+ test.add("only");
+ test.add("Found");
+ test.add("In");
+ test.add("The");
+ test.add("Calander");
+ test.add("of");
+ test.add("Fools");
+ test.add("Get Back To Work");
+
+ String expected ="Tomorrow";
+ String actual = test.get(1);
+
+ Assert.assertEquals(expected,actual);
+
+ }
+
+ @Test
+ public void testSet() {
+ MyArrayList test = new MyArrayList<>();
+ test.add("Coding");
+ test.add("Sucks");
+ test.set(1,"is Fun");
+
+ String expected = "is Fun";
+ String actual = test.get(1);
+
+ Assert.assertEquals(expected,actual);
+ }
+
+ @Test
+ public void testClear1() {
+ MyArrayList test = new MyArrayList<>();
+ test.add(new Integer(1));
+ test.add(new Integer(2));
+ test.add(new Integer(3));
+
+ test.clear();
+
+ boolean actual = test.contains(3);
+ Assert.assertFalse(actual);
+
+ }
+ @Test
+ public void testClear2() {
+ MyArrayList test = new MyArrayList<>();
+ test.add(14L);
+ test.add(55L);
+ test.add(33L);
+
+ test.clear();
+ Integer expected = 0;
+ Integer actual = test.size();
+ Assert.assertEquals(expected,actual);
+
+ }
+ @Test
+ public void testIsEmpty1(){
+ MyArrayList test = new MyArrayList<>(0);
+ boolean actual = test.isEmpty();
+ Assert.assertTrue(actual);
+ }
+ @Test
+ public void testIsEmpty2(){
+ MyArrayList test = new MyArrayList<>(10);
+ boolean actual = test.isEmpty();
+
+ Assert.assertTrue(actual);
+ }
+ @Test
+ public void testIsEmpty3(){
+ MyArrayList test = new MyArrayList<>();
+ test.add(null);
+ boolean actual = test.isEmpty();
+ Assert.assertFalse(actual);
+ }
+ @Test
+ public void testGetCapacity(){
+ MyArrayListtest = new MyArrayList<>(20);
+ test.add(33);
+ test.add(55);
+ test.add(100);
+ Integer actual = test.getCapacity();
+ Integer expected =20;
+ Assert.assertEquals(expected,actual);
+ }
+ @Test
+ public void testTrimToSize2(){
+ MyArrayListtest = new MyArrayList<>(20);
+ test.add(33);
+ test.add(55);
+ test.add(100);
+ test.trimToSize();
+ Integer actual = test.getCapacity();
+ Integer expected =3;
+ Assert.assertEquals(expected,actual);
+ }
+
+}
\ No newline at end of file
diff --git a/src/test/java/MySetTest.java b/src/test/java/MySetTest.java
new file mode 100644
index 0000000..c161214
--- /dev/null
+++ b/src/test/java/MySetTest.java
@@ -0,0 +1,165 @@
+import org.junit.Assert;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+public class MySetTest {
+ //public MySet test;
+
+ @Test
+ public void TestAdd1() {
+ MySet test = new MySet();
+
+ boolean expected = true;
+ boolean actual = test.add(10);
+
+ Assert.assertEquals(expected,actual);
+ }
+
+ @Test
+ public void testAdd2() {
+ MySet test = new MySet<>();
+ test.add(10);
+ test.add(50);
+ test.add(100);
+
+ boolean actual = test.add(50);
+ Assert.assertFalse(actual);
+
+ }
+ @Test
+ public void testAdd3() {
+ MySet test = new MySet<>();
+ test.add(10.0);
+ test.add(50.0);
+ test.add(100.55);
+
+ boolean actual = test.add(100.54);
+ Assert.assertTrue(actual);
+ }
+ @Test
+ public void testAdd4() {
+ MySet test = new MySet<>();
+ test.add("Vince");
+ test.add("Don");
+ test.add("Bryan");
+ test.add("Laurence");
+
+ boolean actual = test.add("Bo");
+ Assert.assertTrue(actual);
+
+ }
+ @Test
+ public void testAdd5() {
+ MySet test = new MySet<>();
+ test.add("Vince");
+ test.add("Don");
+ test.add("Bryan");
+ test.add("Laurence");
+
+ boolean actual = test.add("Laurence");
+ Assert.assertFalse(actual);
+
+ }
+
+
+ @Test
+ public void testRemove1() {
+ MySet test = new MySet<>();
+ test.add("Vince");
+ test.add("Don");
+ test.add("Bryan");
+ test.add("Laurence");
+ test.add("Bo");
+
+ boolean actual = test.remove("Micheal");
+
+ Assert.assertFalse(actual);
+ }
+ @Test
+ public void testRemove2() {
+ MySet test = new MySet<>();
+ test.add("Vince");
+ test.add("Micheal");
+ test.add("Bryan");
+ test.add("Laurence");
+ test.add("Bo");
+ test.add("Don");
+
+ boolean actual = test.remove("Micheal");
+
+ Assert.assertTrue(actual);
+ }
+
+
+ @Test
+ public void testRemove3() {
+ MySet test = new MySet<>();
+ test.add(33.35);
+ test.add(13.78);
+ test.add(45.32);
+ boolean actual = test.remove(13.78);
+ Assert.assertTrue(actual);
+
+ }
+
+ @Test
+ public void testContains1() {
+ MySet test = new MySet<>();
+ test.add(10F);
+ test.add(15.555F);
+ test.add(33.1F);
+
+ boolean actual = test.contains(15.555F);
+ Assert.assertTrue(actual);
+
+
+ }
+ @Test
+ public void testContains2(){
+ MySet test = new MySet<>();
+ test.add(100L);
+ test.add(55555L);
+ test.add(378L);
+
+ boolean actual = test.contains(5555L);
+ Assert.assertFalse(actual);
+
+
+ }
+
+ @Test
+ public void testGet() {
+
+ }
+ @Test
+ public void testSize(){
+ MySet test = new MySet<>();
+ test.add("Thomas");
+ test.add("John");
+ test.add("Joshua");
+
+ int expected = 3;
+ int actual = test.size();
+
+ Assert.assertEquals(expected,actual);
+
+ }
+// @Test
+// public void testEquals(){
+// MySettest1 = new MySet<>();
+// MySettest2 = new MySet<>();
+//
+// test1.add(10);
+// test1.add(12);
+// test1.add(34);
+//
+// test2.add(10);
+// test2.add(12);
+// test2.add(34);
+// boolean expected = true;
+// boolean actual = test2.equals(test1);
+//
+// Assert.assertEquals(expected,actual);
+// }
+}
\ No newline at end of file