Implementation of the Stable Marriage Problem in Java