SharedConnection extends SharedComponent implements AdaptrisConnection { @Override public String getUniqueId() { return getProxiedConnection().getUniqueId(); } SharedConnection();  SharedConnection(String lookupName); @Override void init(); @Override void start(); @Override void stop(); @Override void close(); @Override void changeState(ComponentState newState); @Override ComponentState retrieveComponentState(); @Override void requestInit(); @Override void requestStart(); @Override void requestStop(); @Override void requestClose(); @Override String getUniqueId(); @Override Set<StateManagedComponent> retrieveExceptionListeners(); @Override void addExceptionListener(StateManagedComponent comp); @Override void addMessageProducer(AdaptrisMessageProducer producer); @Override Set<AdaptrisMessageProducer> retrieveMessageProducers(); @Override void addMessageConsumer(AdaptrisMessageConsumer consumer); @Override Set<AdaptrisMessageConsumer> retrieveMessageConsumers(); @Override void setConnectionErrorHandler(ConnectionErrorHandler handler); @Override ConnectionErrorHandler getConnectionErrorHandler(); @Override ConnectionErrorHandler connectionErrorHandler(); @SuppressWarnings("unchecked") @Override T retrieveConnection(Class<T> type); String getLookupName(); void setLookupName(String jndiName); @Override void prepare(); @Override AdaptrisConnection cloneForTesting();  }
@Test public void testGetUniqueId() throws Exception { Adapter a = createAndStart(); NullConnection nc = (NullConnection) a.getSharedComponents().getConnections().get(0); SharedConnection c = new SharedConnection(nc.getUniqueId()); try { assertEquals(nc.getUniqueId(), c.getUniqueId()); } finally { LifecycleHelper.stopAndClose(a); LifecycleHelper.stopAndClose(c); } }