Test a number for primality and return smallest divisor different from 1 if it’s is composite
Single responsibility principle  

You method smallestDivisor() violates the SRP because it does too many things.  

It is   


calculating the smallest divisor  
calculating primes  
checking if the number is neither composite nor prime  


You should consider to just calculate what the name of the method tells you.

Method names should be made out of a verb or a verb phrase, so getSmallestDivisor() would be better.  

So how to handle the edge cases ? That is easy, add methods to evaluate them.  

private static boolean isPrime(int number, int smallestDivisor){
    return number == smallestDivisor;
}

private static boolean isComposite(int number, int smallestDivisor){
   return number != smallestDivisor &amp;&amp; smallestDivisor &gt; 1;
}


The getSmallestDivisor() method should then return as shown below

public static int smallestDivisor(int primeCandidate) {

    if (primeCandidate =&lt; 1) {
        return primeCandidate;
    }
    if (primeCandidate % 2 == 0) {
        return 2;
    } 
    if (primeCandidate % 3 == 0) {
        return 3;
    } 

    // Checks divisability of numbers in the form of 6k+1 and 6k-1.
    // It starts with: 5 and 7, 11 and 13, 17 and 19, 23 and 25, ...
    for (int i = 5; i &lt;= sqrt(primeCandidate); i += 6) {
        if (primeCandidate % i == 0) {
            return i;
        } else if (primeCandidate % (i + 2) == 0) {
            return i + 2;
        }
    }

    return primeCandidate;
}


to be tested like:  

    int smallestDivisor = getSmallestDivisor(primeCandidate);
    if (isPrime(primeCandidate, smallestDivisor)) {
        System.out.println(primeCandidate + " is prime.");
    } else if (isComposite(primeCandidate, smallestDivisor)) {
        System.out.println(primeCandidate + " is composite and has the smallest divisor " + smallestDivisor + ".");
    } else {
        System.out.println(primeCandidate + " is neither prime nor composite.");
    }  


Input  


you haven't checked an edge case: that a user might not pass any argument into the application.  
you should extract the reading of the argument to a separate method and maybe add a possibility, if the given input doesn't match the requirements, to enter the value again. So e.g no arguments provided, value &lt; 0 or not an integer.