DefaultCollectionService extends DefaultJPAService implements CollectionService { @Override public void submitAnnotation(PrincipalUser submitter, Annotation annotation) { submitAnnotations(submitter, Arrays.asList(new Annotation[] { annotation })); } @Inject  DefaultCollectionService(MQService mqService, TSDBService tsdbService, AuditService auditService,
            AnnotationStorageService annotationStorageService, SystemConfiguration configuration, SchemaService schemaService, WardenService wardenService,
            MonitorService monitorService, NamespaceService namespaceService); @Override void submitMetric(PrincipalUser submitter, Metric metric); @Override void submitMetrics(PrincipalUser submitter, List<Metric> metrics); @Override void submitAnnotation(PrincipalUser submitter, Annotation annotation); @Override void submitAnnotations(PrincipalUser submitter, List<Annotation> annotations); @Override List<Metric> commitMetrics(int messageCount, int timeout); @Override int commitMetricSchema(int messageCount, int timeout); @Override int commitAnnotations(int annotationCount, int timeout); @Override int commitHistograms(int histogramCount, int timeout); @Override void submitHistogram(PrincipalUser submitter, Histogram histogram); @Override void submitHistograms(PrincipalUser submitter, List<Histogram> histograms); @Override void dispose();  }
@Test public void testSubmitAnnotation() { Annotation annotation = TestUtils.createAnnotation(); collectionService.submitAnnotation(user, annotation); verify(monitorService).modifyCounter(MonitorService.Counter.ANNOTATION_WRITES, 1, null); }