### Question:
ThumbsBar extends LinearLayout { public void setThumbSpace(int spaceInPixel) { mMeasuredMarginInPixel = spaceInPixel; requestLayout(); } ThumbsBar(Context context, AttributeSet attrs);  ThumbsBar(Context context, AttributeSet attrs, int defStyle); int getHeroIndex(); void setThumbSize(int width, int height); void setHeroThumbSize(int width, int height); void setThumbSpace(int spaceInPixel); void setNumberOfThumbs(int numOfThumbs); void clearThumbBitmaps(); Bitmap getThumbBitmap(int index); void setThumbBitmap(int index, Bitmap bitmap);  }### Answer:
@Test public void checkSetThumbSpace() { mContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); InstrumentationRegistry.getInstrumentation().runOnMainSync(new Runnable() { @Override public void run() { mBar = Mockito.spy(new ThumbsBar(mContext, null)); } }); int thumbSpaceInPixelForTest = 48; mBar.setThumbSpace(thumbSpaceInPixelForTest); assertEquals(mBar.mMeasuredMarginInPixel, thumbSpaceInPixelForTest); verify(mBar).requestLayout(); }