Class CountingConsumer<T>

java.lang.Object
org.soliscode.test.util.CountingConsumer<T>
Type Parameters:
T - The type of the parameter for the accept method.
All Implemented Interfaces:
Consumer<T>

public class CountingConsumer<T> extends Object implements Consumer<T>
Counts how many times the accept() method is called.
Since:
1.0
Author:
evanbergstrom
  • Constructor Details

    • CountingConsumer

      public CountingConsumer()
  • Method Details

    • accept

      public void accept(T t)
      Counts each time this method is called.
      Specified by:
      accept in interface Consumer<T>
      Parameters:
      t - This parameter is ignored.
    • count

      public int count()
      Returns the number of times the accept method has been called.
      Returns:
      the number of times the accept method has been called.