Skip to content

Commit

Permalink
specific generics
Browse files Browse the repository at this point in the history
  • Loading branch information
carterkozak committed Sep 25, 2019
1 parent 987c4d0 commit 0889408
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,19 @@
import com.google.errorprone.refaster.annotation.AfterTemplate;
import com.google.errorprone.refaster.annotation.BeforeTemplate;
import java.util.Collections;
import org.assertj.core.api.AbstractAssert;
import org.assertj.core.api.AbstractIterableAssert;

public final class AssertjCollectionIsEmpty2 {
public final class AssertjCollectionIsEmpty2<A extends AbstractIterableAssert<A, I, T, E>,
I extends Iterable<? extends T>, T, E extends AbstractAssert<E, T>> {

@BeforeTemplate
void before1(AbstractIterableAssert<?, ?, ?, ?> in) {
void before1(A in) {
in.hasSize(0);
}

@BeforeTemplate
void before2(AbstractIterableAssert<?, ?, ?, ?> in) {
void before2(A in) {
in.isEqualTo(Refaster.anyOf(
ImmutableList.of(),
ImmutableSet.of(),
Expand All @@ -41,7 +43,7 @@ void before2(AbstractIterableAssert<?, ?, ?, ?> in) {
}

@AfterTemplate
void after(AbstractIterableAssert<?, ?, ?, ?> in) {
void after(A in) {
in.isEmpty();
}
}

0 comments on commit 0889408

Please sign in to comment.