@Test public void testAdd() throws Exception { SearchTree<String,String> tree = new SearchTree<>(); tree.add(null, null); }
public void add(List<K> cascadingFactors, V value) { if (CollectionValues.isNullOrEmpty(cascadingFactors)) { this.value = value; return; } List<K> factors = Lists.newArrayList(cascadingFactors); K factor = factors.remove(0); ValueCheckers.notNull(factor, "factor"); SearchTree<K, V> child = children.get(factor); if (child == null) { child = new SearchTree<>(); children.put(factor, child); } child.add(factors, value); }
SearchTree { public void add(List<K> cascadingFactors, V value) { if (CollectionValues.isNullOrEmpty(cascadingFactors)) { this.value = value; return; } List<K> factors = Lists.newArrayList(cascadingFactors); K factor = factors.remove(0); ValueCheckers.notNull(factor, "factor"); SearchTree<K, V> child = children.get(factor); if (child == null) { child = new SearchTree<>(); children.put(factor, child); } child.add(factors, value); } }
SearchTree { public void add(List<K> cascadingFactors, V value) { if (CollectionValues.isNullOrEmpty(cascadingFactors)) { this.value = value; return; } List<K> factors = Lists.newArrayList(cascadingFactors); K factor = factors.remove(0); ValueCheckers.notNull(factor, "factor"); SearchTree<K, V> child = children.get(factor); if (child == null) { child = new SearchTree<>(); children.put(factor, child); } child.add(factors, value); }  }
SearchTree { public void add(List<K> cascadingFactors, V value) { if (CollectionValues.isNullOrEmpty(cascadingFactors)) { this.value = value; return; } List<K> factors = Lists.newArrayList(cascadingFactors); K factor = factors.remove(0); ValueCheckers.notNull(factor, "factor"); SearchTree<K, V> child = children.get(factor); if (child == null) { child = new SearchTree<>(); children.put(factor, child); } child.add(factors, value); }  V getValue(); void setValue(V value); V getDefaultChildrenValue(); void setDefaultChildrenValue(V defaultChildrenValue); V get(List<K> cascadingFactors); V first(List<K> cascadingFactors); void add(List<K> cascadingFactors, V value); void put(K childKey, SearchTree<K, V> searchTree); }
SearchTree { public void add(List<K> cascadingFactors, V value) { if (CollectionValues.isNullOrEmpty(cascadingFactors)) { this.value = value; return; } List<K> factors = Lists.newArrayList(cascadingFactors); K factor = factors.remove(0); ValueCheckers.notNull(factor, "factor"); SearchTree<K, V> child = children.get(factor); if (child == null) { child = new SearchTree<>(); children.put(factor, child); } child.add(factors, value); }  V getValue(); void setValue(V value); V getDefaultChildrenValue(); void setDefaultChildrenValue(V defaultChildrenValue); V get(List<K> cascadingFactors); V first(List<K> cascadingFactors); void add(List<K> cascadingFactors, V value); void put(K childKey, SearchTree<K, V> searchTree);  }