TSConnection findTSConnectionForDevice(TSDevice device) {
		Vector<TSConnection> clonedConnsToCheck = new Vector<TSConnection>(this.connections);

		for (int j = 0; j < clonedConnsToCheck.size(); j++) {
			TSConnection conn = (TSConnection) clonedConnsToCheck.elementAt(j);
			Vector<?> cv = conn.getTermConns();
			if ((cv != null) && (cv.size() > 0)) {
				Vector<?> termConns = new Vector<Object>(cv);
				for (int k = 0; k < termConns.size(); k++) {
					TSConnection tc = (TSConnection) termConns.elementAt(k);
					if (tc.getTSDevice() == device) {
						return tc;
					}

				}

			} else if (conn.getTSDevice() == device) {
				return conn;
			}

		}

		return null;
	}