Sum the exponents of the prime factors of a number
In addition to the other answer:


There is no need to generate all primes up to n. You can generate them up to sqrt(n). If something remains after the division by these primes, it is a prime.
There is no need to generate any prime numbers at all. This code does exactly what you need:

public int primeExponentsCount(int n) {
    if (n &lt;= 1)
        return 0;
    int sqrt = (int) Math.sqrt(n);
    int remainingNumber = n;
    int result = 0;
    for (int i = 2; i &lt;= sqrt; i++) {
        while (remainingNumber % i == 0) {
            result++;
            remainingNumber /= i;
        }
    }
    if (remainingNumber &gt; 1) {
        result++;
    }
    return result;
}


The time complexity of this algorithm is O(sqrt(n)). The space complexity is O(1). As you can see, there is much room for improvement for your initial solution in terms of efficiency.


Now about the code itself:


Writing self-evident comments is a bad practice. For instance, this comment doesn't serve any purpose. 

// initialize the sum
int result = 0;


I would delete it. 
Error handling. It looks like your primeExponentsCount does not expect to receive a negative number. Instead of returning a wrong result, I'd throw an exception:

public int primeExponentsCount(int n) {
    if (n &lt; 0)
        throw new IllegalArgumentException("The number must be non-negative");
    ...
}

There are too many blank lines inside methods, in my opinion(it is conventional to separate methods from each other with an empty line, but it is not common to insert random blank lines inside a method's body).