Checking if a Stack is sorted in ascending order
Advice 1

if (s.size() == 1 || s.isEmpty()) {
    return isSorted;
}


You can write more succinctly

if (s.size() &lt; 2) {
    return true;
}


Advice 2

boolean isSorted = true;
if (s.size() == 1 || s.isEmpty()) {
    return isSorted;
}


I suggest you write instead:

if (s.size() == 1 || s.isEmpty()) {
    return true;
}
boolean isSorted = true;


This is a micro-optimization.

Advice 3

Making it generic is not hard. You could demand a type parameter E which extends a Comparable&lt;? super E&gt;

Alternative implementation

I had this in mind:

public static &lt;E extends Comparable&lt;? super E&gt;&gt; 
    boolean isSortedV2(Stack&lt;E&gt; stack) {
    if (stack.size() &lt; 2) {
        return true;
    }

    Stack&lt;E&gt; aux = new Stack&lt;&gt;();
    aux.push(stack.pop());

    while (!stack.isEmpty() &amp;&amp; stack.peek().compareTo(aux.peek()) &gt;= 0) {
        aux.push(stack.pop());
    }

    boolean sorted = stack.isEmpty();

    // Restore the input stack:
    while (!aux.isEmpty()) {
        stack.push(aux.pop());
    }

    return sorted;
}