Verifier { public <T extends Object> void collectiveVerifyZeroInteractions(Collection<T>... mocks) { collectiveVerifyNoMoreInteractions(mocks); }  T collectiveVerify(Class<T> mockClass, Collection<T> collection); T collectiveVerify(Class<T> mockClass, Collection<T> collection, VerificationMode mode); void collectiveVerifyZeroInteractions(Collection<T>... mocks); void collectiveVerifyNoMoreInteractions(Collection<T>... mocks);  }
@Test @SuppressWarnings("unchecked") public void shouldCollectiveVerifyZeroInteractions() { Collection<Object> collection = Arrays.asList(mock(Object.class), mock(Object.class)); verification.collectiveVerifyZeroInteractions(collection); }
@Test @SuppressWarnings("unchecked") public void shouldCollectiveVerifyZeroInteractionsGivenHasInteractions() throws IOException { OutputStream aMock = mock(OutputStream.class); aMock.close(); Collection<OutputStream> collection = Arrays.<OutputStream> asList(aMock); try { verification.collectiveVerifyZeroInteractions(collection); fail("expected exception to be thrown"); } catch (NoInteractionsWanted e) { assertTrue(e.getMessage().contains("No interactions wanted")); } }