public static int getOccurrence(int[] array, int num) {
        if (array == null || array.length == 0) {
            return 0;
        }

        if (array.length >= Math.pow(2, 64)) {
            System.out.println("cannot handle array of that size");
            return 0;
        }

        if (!map.containsKey(array)) {
            Map<Integer, Integer> newTable = new HashMap<>();
            // Hash number of occurrences to the occurring value
            for (final int i : array) {
                if (!newTable.containsKey(i)) {
                    newTable.put(i, 1);
                } else {
                    if (newTable.get(i) + 1 > 0) {
                        newTable.put(i, newTable.get(i) + 1);
                    } else {
                        logger.severe("Maximum number of occurrences for integer reached");
                        throw new LargeNumberException("Maximum number of occurrences for integer reached");
                    }
                }
            }

            map.put(array, newTable);
        }

        Map<Integer, Integer> table = map.get(array);
        if (table.containsKey(num)) {
            System.out.println(table.get(num));
            return table.get(num);
        } else {
            System.out.println("0");
            return 0;
        }
    }