@Test
public void testIsAssumeIdentityWithSystemConnection() {

    ConnectionContext ctx = new ConnectionContext();
    Connection connection = new Connection() {
        @Override
        public Connector getConnector() {
            return null;  //To change body of implemented methods use File | Settings | File Templates.
        }
        @Override
        public void dispatchSync(Command message) {
            //To change body of implemented methods use File | Settings | File Templates.
        }
        @Override
        public void dispatchAsync(Command command) {
            //To change body of implemented methods use File | Settings | File Templates.
        }
        @Override
        public Response service(Command command) {
            return null;  //To change body of implemented methods use File | Settings | File Templates.
        }
        @Override
        public void serviceException(Throwable error) {
            //To change body of implemented methods use File | Settings | File Templates.
        }
        @Override
        public boolean isSlow() {
            return false;  //To change body of implemented methods use File | Settings | File Templates.
        }
        @Override
        public boolean isBlocked() {
            return false;  //To change body of implemented methods use File | Settings | File Templates.
        }
        @Override
        public boolean isConnected() {
            return false;  //To change body of implemented methods use File | Settings | File Templates.
        }
        @Override
        public boolean isActive() {
            return false;  //To change body of implemented methods use File | Settings | File Templates.
        }
        @Override
        public int getDispatchQueueSize() {
            return 0;  //To change body of implemented methods use File | Settings | File Templates.
        }
        @Override
        public ConnectionStatistics getStatistics() {
            return null;  //To change body of implemented methods use File | Settings | File Templates.
        }
        @Override
        public boolean isManageable() {
            return false;  //To change body of implemented methods use File | Settings | File Templates.
        }
        @Override
        public String getRemoteAddress() {
            return "vm://localhost";
        }
        @Override
        public void serviceExceptionAsync(IOException e) {
            //To change body of implemented methods use File | Settings | File Templates.
        }
        @Override
        public String getConnectionId() {
            return null;  //To change body of implemented methods use File | Settings | File Templates.
        }
        @Override
        public boolean isNetworkConnection() {
            return false;  //To change body of implemented methods use File | Settings | File Templates.
        }
        @Override
        public boolean isFaultTolerantConnection() {
            return false;  //To change body of implemented methods use File | Settings | File Templates.
        }
        @Override
        public void updateClient(ConnectionControl control) {
            //To change body of implemented methods use File | Settings | File Templates.
        }
        @Override
        public void start() throws Exception {
            //To change body of implemented methods use File | Settings | File Templates.
        }
        @Override
        public void stop() throws Exception {
            //To change body of implemented methods use File | Settings | File Templates.
        }
        @Override
        public int getActiveTransactionCount() {
            return 0;  //To change body of implemented methods use File | Settings | File Templates.
        }
        @Override
        public Long getOldestActiveTransactionDuration() {
            return null;  //To change body of implemented methods use File | Settings | File Templates.
        }
    };
    ctx.setConnection(connection);
    SubjectConnectionReference sc = new SubjectConnectionReference(ctx, new ConnectionInfo(),
            new DefaultEnvironment(), new SubjectAdapter());
    assertTrue(policy.isAssumeIdentity(sc));
}