### Question:
TcaProtocolCollector implements ProtocolCollector { @Override public CollectionJob collect(final CollectionJob collectionJob) { logger.info("TcaProtocolCollector is collecting collectionJob '{}'", collectionJob); SnmpAgentConfig snmpAgentConfig = SnmpAgentConfig.parseProtocolConfigurationString(collectionJob.getProtocolConfiguration()); List<Collectable> trackers = new ArrayList<Collectable>(); for (final String metricObjId : collectionJob.getAllMetrics()) { final String keyword = metricObjId.substring(metricObjId.lastIndexOf("_") + 1); final SnmpObjId requestOid = SnmpObjId.get(metricObjId.substring(0, metricObjId.lastIndexOf("_"))); SnmpObjId base = requestOid.getPrefix(requestOid.length() - 1); int lastId = requestOid.getLastSubId(); SingleInstanceTracker instanceTracker = new SingleInstanceTracker(base, new SnmpInstId(lastId)) { @Override protected void storeResult(SnmpResult result) { logger.trace("Collected SnmpValue '{}'", result); SnmpValue value = result.getValue(); String compositeResult = getCompositeValue(keyword, value.toDisplayString()); collectionJob.setMetricValue(metricObjId, "int32", compositeResult); } @Override public void setFailed(boolean failed) { super.setFailed(failed); logger.trace("Collection Failed for metricObjId '{}'", metricObjId); collectionJob.setMetricValue(metricObjId, "unknown", null); } @Override public void setTimedOut(boolean timedOut) { super.setTimedOut(timedOut); logger.trace("Collection timedOut for metricObjId '{}'", metricObjId); collectionJob.setMetricValue(metricObjId, "unknown", null); } }; trackers.add(instanceTracker); } CollectionTracker tracker = new AggregateTracker(trackers); SnmpWalker walker = m_snmpStrategy.createWalker(snmpAgentConfig, "SnmpProtocolCollector for " + snmpAgentConfig.getAddress(), tracker); walker.start(); try { walker.waitFor(); } catch (InterruptedException e) { } return collectionJob; }  SnmpStrategy getSnmpStrategy(); void setSnmpStrategy(SnmpStrategy snmpStrategy); @Override CollectionJob collect(final CollectionJob collectionJob); @Override String getProtcol();  }### Answer:
@Test public void testCollectWithCompountMertic() { final String testMetric = ".1.3.6.1.4.1.27091.3.1.6.1.2.171.19.37.60_inboundDelay"; final String testMetricValue = "12"; collectionJob.setService("TCA"); collectionJob.setNodeId(1); collectionJob.setNetInterface(localhost.getHostAddress()); collectionJob.addMetric(testMetric, destinations, "OnmsLocicMetricId"); collectionJob.setId("testing"); CollectionJob result = protocolCollector.collect(collectionJob); Assert.assertNotNull(result); Assert.assertEquals(result.getMetricValue(testMetric), testMetricValue); }