Insertion sort implementation
readAllInts

This is a wishy washy name. What does it mean, "all ints"? In the universe? In my little black book of ints? Entered by the user on standard input? Aha!

It might be good to split this up to multiple methods:


a method to read and return the number of ints from a scanner and handle errors: print a message in case of invalid input and try again, or simply throw an exception
a method to read specified number of ints from a scanner and return as an array
a method that calls the previous two and returns the array


That way each method will have a simpler, single responsibility.

A bigger problem with this method is that it doesn't belong in the InsertionSort class. The way you read an array of integers has nothing to do with the spring algorithm.

Type safety

By not using type tokens, you sacrificed type safety. For example a call less(4, "hello") would compile, which is undesirable.

You should never use bare types, always specify type parameters.
For example you can make less type safe like this:

private static &lt;T extends Comparable&lt;? super T&gt;&gt; boolean less(T v, T w) {
    return v.compareTo(w) &lt; 0;
}


This effectively prevents less(4, "hello") at compile time.

Correcting sort similarly:

public static &lt;T extends Comparable&lt;? super T&gt;&gt; void sort(T[] a) {
    int length = a.length;
    for (int i = 0; i &lt; length; i++) {
        for (int j = i; j &gt; 0; j--) {
            if (less(a[j], a[j - 1])) { // Invariant broken, fix it.
                exch(a, j, j - 1);
            }
        }
    }
}


And that's it, the other methods are fine,
as they don't use bare types, and they are fine using Object[] for swapping and printing.

Naming

exch is not a great name. " exchange " would be better, but the most common name for this operation is "swap".

less is also not great, as some might interpret it in the sense of " minus ". I suggest "lessThan" instead, which makes the comparison logic perfectly clear.

The variable a is the worst offender of all. "swap" is not great either.