@Test public void handleWithNoCallback() { mSource.setCallback(null); mSource.inject(new VehicleMessage()); verify(mCallback, never()).receive(Matchers.any(VehicleMessage.class)); }
@Override public void setCallback(SourceCallback callback) { try { mCallbackLock.lock(); mCallback = callback; mCallbackChanged.signal(); } finally { mCallbackLock.unlock(); } }
BaseVehicleDataSource implements VehicleDataSource { @Override public void setCallback(SourceCallback callback) { try { mCallbackLock.lock(); mCallback = callback; mCallbackChanged.signal(); } finally { mCallbackLock.unlock(); } } }
BaseVehicleDataSource implements VehicleDataSource { @Override public void setCallback(SourceCallback callback) { try { mCallbackLock.lock(); mCallback = callback; mCallbackChanged.signal(); } finally { mCallbackLock.unlock(); } } BaseVehicleDataSource();  BaseVehicleDataSource(SourceCallback callback); }
BaseVehicleDataSource implements VehicleDataSource { @Override public void setCallback(SourceCallback callback) { try { mCallbackLock.lock(); mCallback = callback; mCallbackChanged.signal(); } finally { mCallbackLock.unlock(); } } BaseVehicleDataSource();  BaseVehicleDataSource(SourceCallback callback); @Override void setCallback(SourceCallback callback); abstract boolean isConnected(); @Override void stop(); @Override void onPipelineActivated(); @Override void onPipelineDeactivated(); SourceCallback getCallback(); }
BaseVehicleDataSource implements VehicleDataSource { @Override public void setCallback(SourceCallback callback) { try { mCallbackLock.lock(); mCallback = callback; mCallbackChanged.signal(); } finally { mCallbackLock.unlock(); } } BaseVehicleDataSource();  BaseVehicleDataSource(SourceCallback callback); @Override void setCallback(SourceCallback callback); abstract boolean isConnected(); @Override void stop(); @Override void onPipelineActivated(); @Override void onPipelineDeactivated(); SourceCallback getCallback();  }