@Test public void duplicate() throws Exception { VolatileLookUpTable.Builder<IntOption> builder = new VolatileLookUpTable.Builder<>(); builder.add(key(100), new IntOption(100)); builder.add(key(100), new IntOption(101)); builder.add(key(100), new IntOption(102)); LookUpTable<IntOption> table = builder.build(); assertThat(sort(table.get(key(100))), is(values(100, 101, 102))); assertThat(sort(table.get(key(101))), is(values())); }
@Override public List<T> get(LookUpKey key) { if (key == null) { throw new IllegalArgumentException("key must not be null"); } List<T> list = entity.get(key.getDirectView()); if (list == null) { return Collections.emptyList(); } return list; }
VolatileLookUpTable implements LookUpTable<T> { @Override public List<T> get(LookUpKey key) { if (key == null) { throw new IllegalArgumentException("key must not be null"); } List<T> list = entity.get(key.getDirectView()); if (list == null) { return Collections.emptyList(); } return list; } }
VolatileLookUpTable implements LookUpTable<T> { @Override public List<T> get(LookUpKey key) { if (key == null) { throw new IllegalArgumentException("key must not be null"); } List<T> list = entity.get(key.getDirectView()); if (list == null) { return Collections.emptyList(); } return list; } VolatileLookUpTable(Map<LookUpKey.View, List<T>> entity); }
VolatileLookUpTable implements LookUpTable<T> { @Override public List<T> get(LookUpKey key) { if (key == null) { throw new IllegalArgumentException("key must not be null"); } List<T> list = entity.get(key.getDirectView()); if (list == null) { return Collections.emptyList(); } return list; } VolatileLookUpTable(Map<LookUpKey.View, List<T>> entity); @Override List<T> get(LookUpKey key); }
VolatileLookUpTable implements LookUpTable<T> { @Override public List<T> get(LookUpKey key) { if (key == null) { throw new IllegalArgumentException("key must not be null"); } List<T> list = entity.get(key.getDirectView()); if (list == null) { return Collections.emptyList(); } return list; } VolatileLookUpTable(Map<LookUpKey.View, List<T>> entity); @Override List<T> get(LookUpKey key);  }