### Question:
TransientServiceStatementManager implements ServiceStatementManager { public ServiceStatement[] get() { ServiceStatement[] statements; synchronized (statementMap) { statements = statementMap.values().toArray(new ServiceStatement[statementMap.values().size()]); } return statements; } TransientServiceStatementManager(Configuration config); void terminate(); ServiceStatement[] get(); ServiceStatement get(ServiceElement sElem); void record(ServiceStatement statement);  }### Answer:
@Test public void testGetActiveServiceStatements() throws Exception { ServiceStatement[] statements = serviceStatementManager.get(); List<ServiceRecord> list = new ArrayList<ServiceRecord>(); for (ServiceStatement statement : statements) { ServiceRecord[] records = statement.getServiceRecords(recordingUuid, ServiceRecord.ACTIVE_SERVICE_RECORD); list.addAll(Arrays.asList(records)); } Assert.assertEquals(names.length, list.size()); }
@Test public void testRecordAndRetrieve() throws Exception { Assert.assertEquals(statements.size(), serviceStatementManager.get().length); for(ServiceStatement statement : statements) { ServiceStatement s = serviceStatementManager.get(statement.getServiceElement()); Assert.assertEquals(statement, s); Assert.assertEquals(1, s.getServiceRecords(ServiceRecord.ACTIVE_SERVICE_RECORD).length); Assert.assertEquals(0, s.getServiceRecords(ServiceRecord.INACTIVE_SERVICE_RECORD).length); } }