BlueTape { public static ViewSelector with(Factory factory) { return new ViewSelector(factory); } private  BlueTape(View view, Factory factory); static ViewSelector with(Factory factory); void update();  }
@Test public void create_WithView() throws Exception { BlueTape blueTape = BlueTape .with(factory) .into(view); assertSame(factory, blueTape.factory); assertSame(view, blueTape.view); }
@Test public void create_WithActivity() throws Exception { Activity activity = mock(Activity.class); given(activity.findViewById(android.R.id.content)) .willReturn(view); BlueTape blueTape = BlueTape .with(factory) .into(activity); assertSame(factory, blueTape.factory); assertSame(view, blueTape.view); }