@Test(expected = NullPointerException.class) public void shouldThrowNullPointerExceptionIfUnaryFunctionSuppliedToBuildIsNull() throws Exception { CollectionBuilder<Integer> collectionBuilder = collectionBuilderWith(1, 2, 3); UnaryFunction<Iterable<Integer>, Collection<Integer>> unaryFunction = null; collectionBuilder.build(unaryFunction); }
@Override public Collection<E> build() { return Collections.unmodifiableList(new ArrayList<E>(elements)); }
CollectionBuilder extends AbstractBuilder<E, CollectionBuilder<E>, Collection<E>> implements AbstractBuilder.WithCustomImplementationSupport<E, Collection, Collection<E>> { @Override public Collection<E> build() { return Collections.unmodifiableList(new ArrayList<E>(elements)); } }
CollectionBuilder extends AbstractBuilder<E, CollectionBuilder<E>, Collection<E>> implements AbstractBuilder.WithCustomImplementationSupport<E, Collection, Collection<E>> { @Override public Collection<E> build() { return Collections.unmodifiableList(new ArrayList<E>(elements)); }  }
CollectionBuilder extends AbstractBuilder<E, CollectionBuilder<E>, Collection<E>> implements AbstractBuilder.WithCustomImplementationSupport<E, Collection, Collection<E>> { @Override public Collection<E> build() { return Collections.unmodifiableList(new ArrayList<E>(elements)); }  static CollectionBuilder<E> collectionBuilder(); static CollectionBuilder<E> collectionBuilder(Class<E> elementClass); @Override Collection<E> build(); @Override Collection<E> build(Class<? extends Collection> implementationClass); @Override T build(UnaryFunction<? super Iterable<E>, ? extends T> builderFunction); }
CollectionBuilder extends AbstractBuilder<E, CollectionBuilder<E>, Collection<E>> implements AbstractBuilder.WithCustomImplementationSupport<E, Collection, Collection<E>> { @Override public Collection<E> build() { return Collections.unmodifiableList(new ArrayList<E>(elements)); }  static CollectionBuilder<E> collectionBuilder(); static CollectionBuilder<E> collectionBuilder(Class<E> elementClass); @Override Collection<E> build(); @Override Collection<E> build(Class<? extends Collection> implementationClass); @Override T build(UnaryFunction<? super Iterable<E>, ? extends T> builderFunction);  }