Intersection of Array Question, limited only to methods
If you want to optimize you can : Use arrayCopy() from the System Class to create the final array and reduce variable. Here is my "solution" : 

public static Object[] handleArrayIntersection(Object[] array1, Object[] array2) {
    Object[] dest;

    int itemCount = 0;
    Object[] intersect = new Object[array1.length &lt; array2.length ? array1.length : array2.length];

    for(int i = 0; i &lt; array1.length; i++) {
        Object arr1Val = array1[i];
        if(contains(array2, arr1Val) &amp;&amp; !contains(intersect, arr1Val)) {
            intersect[itemCount++] = arr1Val;
        }
    }

    dest = new Object[itemCount];
    if(itemCount &gt; 0) {
        System.arraycopy(intersect, 0, dest, 0, itemCount);
    }

    return dest;
}