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..387e99e
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,593 @@
+
+
+
+
+
+
+
+
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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..98210c0
--- /dev/null
+++ b/src/main/java/MyArrayList.java
@@ -0,0 +1,96 @@
+import java.util.Arrays;
+
+public class MyArrayList {
+
+ private E[] theArray;
+
+ public MyArrayList() {
+ theArray = (E[]) new Object[0];
+ }
+
+ public MyArrayList(int size) {
+ theArray = (E[]) new Object[size];
+ }
+
+ public void add(E thingToAdd) {
+ E[] newArray = Arrays.copyOf(this.theArray, this.theArray.length + 1);
+ newArray[newArray.length-1] = thingToAdd;
+ this.theArray = newArray;
+ }
+
+ public E[] toArray() {
+ return theArray;
+ }
+
+ public boolean remove(E thingToRemove) {
+ // If thing is found and removed, returns true. If thing is not found, returns false
+ int counter = 0;
+ for (int i = 0; i < theArray.length; i++) {
+ if (theArray[i].equals(thingToRemove)) {
+ counter++;
+ }
+ }
+ if (counter == 0) {return false;}
+ E[] newArray = Arrays.copyOf(this.theArray, this.theArray.length - counter);
+ counter = 0;
+ for (int i = 0; i < theArray.length; i++) {
+ if (!(theArray[i].equals(thingToRemove))) {
+ newArray[counter] = theArray[i];
+ counter++;
+ }
+ }
+ this.theArray = newArray;
+ return true;
+ }
+
+ public E removeAtIndex(int index) {
+ // Removes E from the array and returns it, if the index is out of bounds it returns null
+ if (index > theArray.length - 1 || index < 0) {
+ return null;
+ } else {
+ E[] newArray = Arrays.copyOf(this.theArray, this.theArray.length - 1);
+ int indexOfNewArray = 0;
+ E returnValue = theArray[index];
+ for (int i = 0; i < theArray.length; i++) {
+ if (i == index) {
+ continue;
+ } else {
+ newArray[indexOfNewArray] = theArray[i];
+ indexOfNewArray++;
+ }
+ }
+ this.theArray = newArray;
+ return returnValue;
+ }
+ }
+
+ public void setTheArray(E[] theArray) {
+ this.theArray = theArray;
+ }
+
+ public void setAtIndex(int index, E thingToSet) {
+ this.theArray[index] = thingToSet;
+ }
+
+ public void clear() {
+ this.theArray = Arrays.copyOf(theArray, 0);
+ }
+
+ public boolean isEmpty() {
+ return theArray.length == 0;
+ }
+
+ public boolean contains(E thingToCheckFor) {
+ for (E aTheArray : theArray) {
+ if (aTheArray.equals(thingToCheckFor)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public int size() {
+ return theArray.length;
+ }
+
+}
diff --git a/src/main/java/MySet.java b/src/main/java/MySet.java
new file mode 100644
index 0000000..8e7a061
--- /dev/null
+++ b/src/main/java/MySet.java
@@ -0,0 +1,40 @@
+public class MySet{
+
+ private MyArrayList myArrayList = new MyArrayList();
+
+ public MySet() {
+ this.myArrayList = new MyArrayList();
+ }
+
+ public void add(E thingToAdd) {
+ if (!(myArrayList.contains(thingToAdd))) {
+ myArrayList.add(thingToAdd);
+ }
+ }
+
+ public int size() {
+ return myArrayList.size();
+ }
+
+ public void clear() {
+ myArrayList.clear();
+ }
+
+ public E[] toArray() {
+ return (E[]) myArrayList.toArray();
+ }
+
+ public boolean contains(E thing) {
+ return myArrayList.contains(thing);
+ }
+
+ public boolean isEmpty() {
+ return myArrayList.isEmpty();
+ }
+
+
+
+ // Recreate all methods, have them call MyArrayList methods
+ // Only ones that need to be different are add because it needs to check the array for the thing you're trying to add first
+
+}
diff --git a/src/test/java/.deleteme b/src/test/java/.deleteme
deleted file mode 100644
index e69de29..0000000
diff --git a/src/test/java/MyArrayListTest.java b/src/test/java/MyArrayListTest.java
new file mode 100644
index 0000000..8a55db7
--- /dev/null
+++ b/src/test/java/MyArrayListTest.java
@@ -0,0 +1,137 @@
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.Arrays;
+
+public class MyArrayListTest {
+
+ @Test
+ public void setTheArrayTest() {
+ MyArrayList myArrayList = new MyArrayList();
+ Integer[] setArray = {1, 2, 3, 4};
+ myArrayList.setTheArray(setArray);
+ int expected = 4;
+ int actual = myArrayList.toArray().length;
+ Assert.assertEquals(expected, actual);
+ }
+
+ @Test
+ public void getTheArrayTest() {
+ MyArrayList myArrayList = new MyArrayList();
+ Double[] setArray = {1.0, 2.0, 3.0, 4.0};
+ myArrayList.setTheArray(setArray);
+ Assert.assertArrayEquals(myArrayList.toArray(), setArray);
+ }
+
+ @Test
+ public void addTest() {
+ MyArrayList myArrayList = new MyArrayList();
+ myArrayList.add(8L);
+ myArrayList.add(9L);
+ int expected = 2;
+ int actual = myArrayList.toArray().length;
+ Assert.assertEquals(expected, actual);
+ }
+
+ @Test
+ public void removeTestSuccess() {
+ MyArrayList myArrayList = new MyArrayList();
+ Integer[] setArray = {1, 2, 3, 4};
+ myArrayList.setTheArray(setArray);
+ Assert.assertTrue(myArrayList.remove(2));
+ }
+
+ @Test
+ public void removeTestMultiple() {
+ MyArrayList myArrayList = new MyArrayList();
+ Byte[] setArray = {1, 2, 3, 4, 5, 6, 5};
+ myArrayList.setTheArray(setArray);
+ myArrayList.remove(5);
+ int expected = 5;
+ int actual = myArrayList.toArray().length;
+ System.out.println(Arrays.toString(myArrayList.toArray()));
+ Assert.assertEquals(expected, actual);
+ }
+
+ @Test
+ public void removeTestFail() {
+ MyArrayList myArrayList = new MyArrayList();
+ Integer[] setArray = {1, 2, 3, 4};
+ myArrayList.setTheArray(setArray);
+ Assert.assertTrue(!(myArrayList.remove(5)));
+ }
+
+ @Test
+ public void removeAtIndexTestSuccess() {
+ MyArrayList myArrayList = new MyArrayList();
+ Integer[] setArray = {1, 2, 3, 4};
+ myArrayList.setTheArray(setArray);
+ myArrayList.removeAtIndex(1);
+ Integer[] expected = {1, 3, 4};
+ Integer[] actual = (Integer[]) myArrayList.toArray();
+ Assert.assertArrayEquals(expected, actual);
+ }
+
+ @Test
+ public void removeAtIndexFail() {
+ MyArrayList myArrayList = new MyArrayList();
+ Integer[] setArray = {1, 2, 3, 4};
+ myArrayList.setTheArray(setArray);
+ Assert.assertEquals(myArrayList.removeAtIndex(6), null);
+ }
+
+ @Test
+ public void clearTest() {
+ MyArrayList myArrayList = new MyArrayList();
+ Integer[] setArray = {1, 2, 3, 4};
+ myArrayList.setTheArray(setArray);
+ myArrayList.clear();
+ Integer[] expected = {};
+ Assert.assertArrayEquals(expected, myArrayList.toArray());
+ }
+
+ @Test
+ public void isEmptyTest() {
+ MyArrayList myArrayList = new MyArrayList();
+ Object[] setArray = {};
+ myArrayList.setTheArray(setArray);
+ Assert.assertTrue(myArrayList.isEmpty());
+ }
+
+ @Test
+ public void containsTestSuccess() {
+ MyArrayList myArrayList = new MyArrayList();
+ String[] setArray = {"does", "this", "work"};
+ myArrayList.setTheArray(setArray);
+ Assert.assertTrue(myArrayList.contains("this"));
+ }
+
+ @Test
+ public void containsTestFail() {
+ MyArrayList myArrayList = new MyArrayList();
+ String[] setArray = {"does", "this", "work"};
+ myArrayList.setTheArray(setArray);
+ Assert.assertTrue(!(myArrayList.contains("nope")));
+ }
+
+ @Test
+ public void setAtIndexTest() {
+ MyArrayList myArrayList = new MyArrayList();
+ String[] setArray = {"does", "this", "work"};
+ myArrayList.setTheArray(setArray);
+ String here = "here";
+ myArrayList.setAtIndex(1, here);
+ Assert.assertEquals(myArrayList.toArray()[1], here);
+ }
+
+ @Test
+ public void sizeTest() {
+ MyArrayList myArrayList = new MyArrayList();
+ Short[] setArray = {3, 4, 5, 6, 7};
+ myArrayList.setTheArray(setArray);
+ int expected = 5;
+ int actual = myArrayList.size();
+ Assert.assertEquals(expected, actual);
+ }
+
+}
diff --git a/src/test/java/MySetTest.java b/src/test/java/MySetTest.java
new file mode 100644
index 0000000..85dad2f
--- /dev/null
+++ b/src/test/java/MySetTest.java
@@ -0,0 +1,59 @@
+import org.junit.Assert;
+import org.junit.Test;
+
+public class MySetTest {
+
+ @Test
+ public void addTest() {
+ // If this fails you're fucked lol
+ MySet mySet = new MySet();
+ mySet.add(1);
+ mySet.add(2);
+ mySet.add(3);
+ int expected = 3;
+ int actual = mySet.size();
+ Assert.assertEquals(expected, actual);
+ }
+
+ @Test
+ public void sizeTest() {
+ MySet mySet = new MySet();
+ mySet.add(1);
+ mySet.add(2);
+ Assert.assertEquals(mySet.size(), 2);
+ }
+
+ @Test
+ public void clearTest() {
+ MySet mySet = new MySet();
+ mySet.add(1);
+ mySet.add(2);
+ mySet.clear();
+ Assert.assertEquals(mySet.size(), 0);
+ }
+
+ @Test
+ public void toArrayTest() {
+ MySet mySet = new MySet();
+ Integer[] expected = {1, 2};
+ mySet.add(1);
+ mySet.add(2);
+ Assert.assertArrayEquals(mySet.toArray(), expected);
+ }
+
+ @Test
+ public void containsTest() {
+ MySet mySet = new MySet();
+ mySet.add(1);
+ mySet.add(2);
+ mySet.add(3);
+ Assert.assertTrue(mySet.contains(2));
+ }
+
+ @Test
+ public void isEmptyTest() {
+ MySet mySet = new MySet();
+ Assert.assertTrue(mySet.isEmpty());
+ }
+
+}