Skip to content

Commit

Permalink
Add dummy map in fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
Col-E committed Jun 12, 2024
1 parent 8ffd8b4 commit 75bceba
Showing 1 changed file with 69 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package software.coley.recaf.test.dummy;

import java.util.Collection;
import java.util.Collections;
import java.util.Map;
import java.util.Set;

public class DummyEmptyMap<K, V> implements Map<K, V> {

@Override
public int size() {
return 0;
}

@Override
public boolean isEmpty() {
return true;
}

@Override
public boolean containsKey(Object key) {
return false;
}

@Override
public boolean containsValue(Object value) {
return false;
}

@Override
public V get(Object key) {
return null;
}

@Override
public V put(K key, V value) {
return null;
}

@Override
public V remove(Object key) {
return null;
}

@Override
public void putAll(Map<? extends K, ? extends V> m) {
// no-op
}

@Override
public void clear() {
// no-op
}

@Override
public Set<K> keySet() {
return Collections.emptySet();
}

@Override
public Collection<V> values() {
return Collections.emptySet();
}

@Override
public Set<Entry<K, V>> entrySet() {
return Collections.emptySet();
}
}

0 comments on commit 75bceba

Please sign in to comment.