Detecting if two given strings are isomorphic using Java data structures
Your build two HashMap&lt;Character, Integer&gt;, then two ArrayList&lt;Integer&gt;, then sort the lists, then compare the lists.  Your logic is too complicated, I think.  Furthermore, you aren't taking advantage of the symmetry in the problem — nearly every line of code appears in duplicate. Even worse, the code doesn't even do what you claim; rather, it tests whether the inputs are isomorphic anagrams of each other.

Going by the definition, we can just build a character-to-character map from one string to the other, and fail as soon as we encounter an unexpected character.  This should be O(n), and possibly faster if a mismatch is detected early.

The code works equally well on any pair of CharSequences, not just Strings, so we might as well generalize.

import java.util.HashMap;
import java.util.Map;

public class IsomorphicStrings {
    public static boolean areIsomorphic(CharSequence s1, CharSequence s2) {
        return isSurjective(s1, s2) &amp;&amp; isSurjective(s2, s1);
    }

    private static boolean isSurjective(CharSequence s1, CharSequence s2) {
        if (s1.length() != s2.length()) return false;

        Map&lt;Character, Character&gt; surjection = new HashMap&lt;&gt;();
        for (int i = 0; i &lt; s1.length(); i++) {
            char c1 = s1.charAt(i);
            char c2 = s2.charAt(i);
            Character prev = surjection.put(c1, c2);
            if (prev != null &amp;&amp; prev != c2) {
                return false;
            }
        }
        return true;
    }

    public static void main(String[] args) {
        System.out.println(areIsomorphic(args[0], args[1]));
    }
}