question: public Rectangle [ ] computeGaps ( ) { ArrayList < Rectangle > ret = new ArrayList < > ( ) ; Rectangle gap = new Rectangle ( ) ; for ( int i = 0 ; i < mRectList . length ; i ++ ) { Rectangle rectangleA = mRectList [ i ] ; for ( int j = i + 1 ; j < mRectList . length ; j ++ ) { Rectangle rectangleB = mRectList [ j ] ; boolean viable = calculateGap ( rectangleA , rectangleB , gap ) ; if ( viable ) { for ( int k = 0 ; k < mRectList . length ; k ++ ) { if ( k != j && k != i ) { if ( gap . intersects ( mRectList [ k ] ) ) { viable = false ; break ; } } } } if ( viable ) { ret . add ( new Rectangle ( gap ) ) ; } } } return ret . toArray ( new Rectangle [ ret . size ( ) ] ) ; }
target:  build a array of rectangles representing the gaps used for debugging purposes