Validating that a Java program has two equal-length arguments
I took your code and rewrote it a bit, so that it satisfies my personal requirements for production-ready code.

if (args.length &lt; 2) {
    System.err.println("usage: Task &lt;arg1&gt; &lt;arg2&gt;");
    System.exit(1);
}


I removed the throw new Exception since passing the wrong number of arguments is not a programming error but a wrong invocation of the program. Only programming errors should print a stack trace. Instead of saying "Need 2 string arguments" I am following the "usage:" pattern that has been successfully established by Unix programs. Since you didn't provide any context in your question, the best variable names I could come up with are &lt;arg1&gt; &lt;arg2&gt;. If your task were to copy a file, the usage line should better be usage: Copy &lt;source&gt; &lt;target&gt;, of course.

} catch (IllegalArgumentException e) {
    System.err.println(e.getMessage());
    System.exit(1);
}


I added the System.exit since it was missing. If the program fails, it must report this via System.exit or by throwing an exception from the main function.

private static int processResult(String inputOne, String inputTwo) {
    if (inputOne.length() != inputTwo.length()) {
        throw new IllegalArgumentException("Strings must be the same length");
    }


There's no need to have a separate function for checking the lengths of the strings. Using IntelliJ it was quite simple to inline the method call to lengthsEqual (I just pressed Ctrl+Alt+N) and to remove the redundant call to Integer.compare (which was already marked in dark gray, so I just had to press Alt+Enter there).

It's unfortunate that the exception message says "String must be the same length". This message does not tell which strings are meant, and since that message is printed to System.err later, it should be worded with the same care as the usage message.

I disagree with bag's answer, especially the part that commercial code needs to be extensible. It doesn't. It needs to be easy to read, and it needs to clearly tell its intention. If the business requires that the two strings be equal (for whatever reason), the code should say exactly this, and the code should match the wording of the original requirement as closely as possible, so that later changes to the requirements can be programmed as easily as possible.