shadows/framework/src/main/java/org/robolectric/shadows/ShadowDisplay.java
public void setYdpi(float ydpi) {
    if (isJB()) {
      this.ydpi = ydpi;
    } else {
      ShadowDisplayManager.changeDisplay(realObject.getDisplayId(),
          di -> di.physicalYDpi = ydpi);
    }
  }
public void setYdpi(float ydpi) {
    if (isJB()) {
      this.ydpi = ydpi;
    } else {
      ShadowDisplayManager.changeDisplay(realObject.getDisplayId(),
          di -> di.physicalYDpi = ydpi);
    }
  }
public void setYdpi ( float ydpi ) { if ( isJB ( ) ) { this . ydpi = ydpi ; } else { ShadowDisplayManager . changeDisplay ( realObject . getDisplayId ( ) , di -> di . physicalYDpi = ydpi ) ; } }
Changes the vertical DPI for this display.

Any registered {@link android.hardware.display.DisplayManager.DisplayListener}s will be
notified of the change.
Changes the vertical DPI for this display .