shadows/framework/src/main/java/org/robolectric/shadows/ShadowAccessibilityWindowInfo.java
public static boolean areThereUnrecycledWindows(boolean printUnrecycledWindowsToSystemErr) {
    if (printUnrecycledWindowsToSystemErr) {
      for (final StrictEqualityWindowWrapper wrapper : obtainedInstances.keySet()) {
        final ShadowAccessibilityWindowInfo shadow = Shadow.extract(wrapper.mInfo);

        System.err.println(String.format(
            "Leaked type = %d, id = %d. Stack trace:", shadow.getType(), shadow.getId()));
        for (final StackTraceElement stackTraceElement : obtainedInstances.get(wrapper)) {
          System.err.println(stackTraceElement.toString());
        }
      }
    }

    return (obtainedInstances.size() != 0);
  }
public static boolean areThereUnrecycledWindows(boolean printUnrecycledWindowsToSystemErr) {
    if (printUnrecycledWindowsToSystemErr) {
      for (final StrictEqualityWindowWrapper wrapper : obtainedInstances.keySet()) {
        final ShadowAccessibilityWindowInfo shadow = Shadow.extract(wrapper.mInfo);

        System.err.println(String.format(
            "Leaked type = %d, id = %d. Stack trace:", shadow.getType(), shadow.getId()));
        for (final StackTraceElement stackTraceElement : obtainedInstances.get(wrapper)) {
          System.err.println(stackTraceElement.toString());
        }
      }
    }

    return (obtainedInstances.size() != 0);
  }
public static boolean areThereUnrecycledWindows ( boolean printUnrecycledWindowsToSystemErr ) { if ( printUnrecycledWindowsToSystemErr ) { for ( final StrictEqualityWindowWrapper wrapper : obtainedInstances . keySet ( ) ) { final ShadowAccessibilityWindowInfo shadow = Shadow . extract ( wrapper . mInfo ) ; System . err . println ( String . format ( "Leaked type = %d, id = %d. Stack trace:" , shadow . getType ( ) , shadow . getId ( ) ) ) ; for ( final StackTraceElement stackTraceElement : obtainedInstances . get ( wrapper ) ) { System . err . println ( stackTraceElement . toString ( ) ) ; } } } return ( obtainedInstances . size ( ) != 0 ) ; }
Check for leaked objects that were {@code obtain}ed but never
{@code recycle}d.

@param printUnrecycledWindowsToSystemErr - if true, stack traces of calls
to {@code obtain} that lack matching calls to {@code recycle} are
dumped to System.err.
@return {@code true} if there are unrecycled windows
Check for leaked objects that were { @code obtain } ed but never { @code recycle } d .