@Test public void testUnregisterCallsFromEmptyCallManager() { final MgcpCallManager callManager = new GlobalMgcpCallManager(); final Set<MgcpCall> unregistered = callManager.unregisterCalls(); assertNotNull(unregistered); assertTrue(unregistered.isEmpty()); }
@Override public Set<MgcpCall> unregisterCalls() { Set<MgcpCall> values; if (this.calls.isEmpty()) { values = Collections.<MgcpCall> emptySet(); } else { values = new HashSet<>(this.calls.values()); this.calls.clear(); if (log.isDebugEnabled()) { log.debug("Unregistered "+ values.size() +" calls: " + Arrays.toString(getCallHexId(values))); } } return values; }
GlobalMgcpCallManager implements MgcpCallManager { @Override public Set<MgcpCall> unregisterCalls() { Set<MgcpCall> values; if (this.calls.isEmpty()) { values = Collections.<MgcpCall> emptySet(); } else { values = new HashSet<>(this.calls.values()); this.calls.clear(); if (log.isDebugEnabled()) { log.debug("Unregistered "+ values.size() +" calls: " + Arrays.toString(getCallHexId(values))); } } return values; } }
GlobalMgcpCallManager implements MgcpCallManager { @Override public Set<MgcpCall> unregisterCalls() { Set<MgcpCall> values; if (this.calls.isEmpty()) { values = Collections.<MgcpCall> emptySet(); } else { values = new HashSet<>(this.calls.values()); this.calls.clear(); if (log.isDebugEnabled()) { log.debug("Unregistered "+ values.size() +" calls: " + Arrays.toString(getCallHexId(values))); } } return values; } GlobalMgcpCallManager(); }
GlobalMgcpCallManager implements MgcpCallManager { @Override public Set<MgcpCall> unregisterCalls() { Set<MgcpCall> values; if (this.calls.isEmpty()) { values = Collections.<MgcpCall> emptySet(); } else { values = new HashSet<>(this.calls.values()); this.calls.clear(); if (log.isDebugEnabled()) { log.debug("Unregistered "+ values.size() +" calls: " + Arrays.toString(getCallHexId(values))); } } return values; } GlobalMgcpCallManager(); @Override MgcpCall getCall(int callId); @Override boolean registerCall(MgcpCall call); @Override MgcpCall unregisterCall(int callId); @Override Set<MgcpCall> unregisterCalls(); }
GlobalMgcpCallManager implements MgcpCallManager { @Override public Set<MgcpCall> unregisterCalls() { Set<MgcpCall> values; if (this.calls.isEmpty()) { values = Collections.<MgcpCall> emptySet(); } else { values = new HashSet<>(this.calls.values()); this.calls.clear(); if (log.isDebugEnabled()) { log.debug("Unregistered "+ values.size() +" calls: " + Arrays.toString(getCallHexId(values))); } } return values; } GlobalMgcpCallManager(); @Override MgcpCall getCall(int callId); @Override boolean registerCall(MgcpCall call); @Override MgcpCall unregisterCall(int callId); @Override Set<MgcpCall> unregisterCalls();  }