Scoop { public static Scoop fromView(View view) { if (view == null) { return null; } return fromContext(view.getContext()); } private  Scoop(String name, Scoop parent, Map<String, Object> services); void destroy(); T findService(String serviceName); String getName(); Scoop getParent(); Scoop findChild(String childName); static Scoop fromView(View view); static Scoop fromContext(Context context); LayoutInflater inflater(Context context); Context createContext(Context context); View inflate(int layoutId, ViewGroup viewGroup, boolean attachToRoot);  }
@Test public void fromNullView() { assertNull(Scoop.fromView(null)); }
@Test public void fromViewNoScoop() { try { Scoop.fromView(new TestView(RuntimeEnvironment.application)); fail("Should have thrown a RuntimeException if there is no scoop in the view's context."); } catch (RuntimeException e) { } }