@Test public void removeChannel() { final InMemoryDataStore store = new InMemoryDataStore(); store.saveChannel(mockChannel(UUIDUtil.newUAID(), "channel-1", 1, "endpointToken")); store.removeChannels(new HashSet<String>(Arrays.asList("channel-1"))); assertThat(hasChannel("channel-1", store), is(false)); }
private boolean removeChannel(final String channelId) { checkNotNull(channelId, "channelId"); final Channel channel = channels.remove(channelId); if (channel != null) { endpoints.remove(endpoints.get(channel.getEndpointToken())); } return channel != null; }
InMemoryDataStore implements DataStore { private boolean removeChannel(final String channelId) { checkNotNull(channelId, "channelId"); final Channel channel = channels.remove(channelId); if (channel != null) { endpoints.remove(endpoints.get(channel.getEndpointToken())); } return channel != null; } }
InMemoryDataStore implements DataStore { private boolean removeChannel(final String channelId) { checkNotNull(channelId, "channelId"); final Channel channel = channels.remove(channelId); if (channel != null) { endpoints.remove(endpoints.get(channel.getEndpointToken())); } return channel != null; }  }
InMemoryDataStore implements DataStore { private boolean removeChannel(final String channelId) { checkNotNull(channelId, "channelId"); final Channel channel = channels.remove(channelId); if (channel != null) { endpoints.remove(endpoints.get(channel.getEndpointToken())); } return channel != null; }  @Override void savePrivateKeySalt(final byte[] salt); @Override byte[] getPrivateKeySalt(); @Override boolean saveChannel(final Channel ch); @Override Channel getChannel(final String channelId); @Override void removeChannels(final String uaid); @Override void removeChannels(final Set<String> channelIds); @Override Set<String> getChannelIds(final String uaid); @Override String updateVersion(final String endpointToken, final long version); @Override String saveUnacknowledged(final String channelId, final long version); @Override Set<Ack> getUnacknowledged(final String uaid); @Override Set<Ack> removeAcknowledged(final String uaid, final Set<Ack> acked); }
InMemoryDataStore implements DataStore { private boolean removeChannel(final String channelId) { checkNotNull(channelId, "channelId"); final Channel channel = channels.remove(channelId); if (channel != null) { endpoints.remove(endpoints.get(channel.getEndpointToken())); } return channel != null; }  @Override void savePrivateKeySalt(final byte[] salt); @Override byte[] getPrivateKeySalt(); @Override boolean saveChannel(final Channel ch); @Override Channel getChannel(final String channelId); @Override void removeChannels(final String uaid); @Override void removeChannels(final Set<String> channelIds); @Override Set<String> getChannelIds(final String uaid); @Override String updateVersion(final String endpointToken, final long version); @Override String saveUnacknowledged(final String channelId, final long version); @Override Set<Ack> getUnacknowledged(final String uaid); @Override Set<Ack> removeAcknowledged(final String uaid, final Set<Ack> acked);  }