[Java] fixed NullPointerException in UIElementStateUtil