code: @Implementation
    protected Window getWindow() {
      Window window = directlyOn(realActivity, Activity.class).getWindow();
  
      if (window == null) {
        try {
          window = ShadowWindow.create(realActivity);
          setWindow(window);
        } catch (Exception e) {
          throw new RuntimeException("Window creation failed!", e);
        }
      }
  
      return window;
    }
docs: Constructs a new Window (a {@link com.android.internal.policy.impl.PhoneWindow}) if no window
  has previously been set.
  
  @return the window associated with this Activity