### Question:
Component { public static <T> Component.Builder<T> builder(Class<T> anInterface) { return new Builder<>(anInterface); } private  Component(
      Set<Class<? super T>> providedInterfaces,
      Set<Dependency> dependencies,
      @Instantiation int instantiation,
      @ComponentType int type,
      ComponentFactory<T> factory,
      Set<Class<?>> publishedEvents); Set<Class<? super T>> getProvidedInterfaces(); Set<Dependency> getDependencies(); ComponentFactory<T> getFactory(); Set<Class<?>> getPublishedEvents(); boolean isLazy(); boolean isAlwaysEager(); boolean isEagerInDefaultApp(); boolean isValue(); @Override String toString(); static Component.Builder<T> builder(Class<T> anInterface); @SafeVarargs static Component.Builder<T> builder(
      Class<T> anInterface, Class<? super T>... additionalInterfaces); @Deprecated static Component<T> of(Class<T> anInterface, T value); @SafeVarargs static Component<T> of(
      T value, Class<T> anInterface, Class<? super T>... additionalInterfaces); static Component.Builder<T> intoSetBuilder(Class<T> anInterface); static Component<T> intoSet(T value, Class<T> anInterface);  }### Answer:
@Test public void updatingInstantiationMultipleTimes_shouldThrow() { Component.Builder<TestClass> builder = Component.builder(TestClass.class).eagerInDefaultApp(); try { builder.alwaysEager(); fail("Expected exception not thrown."); } catch (IllegalStateException ex) { } }
@Test public void addRequiredDependency_onSelf_shouldThrow() { try { Component.builder(TestClass.class).add(Dependency.required(TestClass.class)); fail("Expected exception not thrown."); } catch (IllegalArgumentException ex) { } }
@Test public void addOptionalDependency_onSelf_shouldThrow() { try { Component.builder(TestClass.class).add(Dependency.optional(TestClass.class)); fail("Expected exception not thrown."); } catch (IllegalArgumentException ex) { } }
@Test public void build_withNoFactoryProvided_shouldThrow() { Component.Builder<TestClass> builder = Component.builder(TestClass.class); try { builder.build(); fail("Expected exception not thrown."); } catch (IllegalStateException e) { } }