private static String getStringInput() { // first, we record that the SUT issued a call to // JOptionPane.showInputDialog() JOptionPaneInputs.getInstance().addDialog(GUIAction.STRING_INPUT); // second, we check if an input is specified for that GUI stimulus if (JOptionPaneInputs.getInstance().containsStringInput()) { // return the specified input final String str = JOptionPaneInputs.getInstance().dequeueStringInput(); return str; } else { // return null by default if no input was specified return null; } }