PubsubPluginSink implements BatchablePluginSink { @Override public void sendBatch(final Batch batch) { sendBatches(Collections.singletonList(batch)); }  @Override boolean isReady(); @Override void init(); @Override AsyncFuture<Void> sendMetrics(Collection<Metric> metrics); @Override AsyncFuture<Void> sendBatches(Collection<Batch> batches); @Override void sendMetric(final Metric metric); @Override void sendBatch(final Batch batch); @Override AsyncFuture<Void> start(); @Override AsyncFuture<Void> stop();  }
@Test public void testSendBatch() { final Batch batch = Batch.create(Optional.of(ImmutableMap.of("tag1", "foo")), Optional.of(ImmutableMap.of("resource", "foo")), ImmutableList.of(metric.toBatchPoint())); sink.sendBatch(batch); verify(publisher).publish(isA(PubsubMessage.class)); }