MCPcopy Create free account
hub / github.com/Freeze777/SDE-Interviewer-Notes / MySet

Class MySet

CleanCode/src/test/java/FoodPandaTest.java:17–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15}
16
17class MySet<T> implements ISet<T> {
18 private final ArrayList<T> store = new ArrayList<>();
19 @Override
20 public void Push(T t) throws IllegalArgumentException {
21 if (t == null)
22 throw new IllegalArgumentException();
23 if (store.stream().noneMatch(e -> e.equals(t)))
24 store.add(t);
25 }
26
27 @Override
28 public T Pop() throws NoSuchElementException {
29 return null;
30 }
31
32 @Override
33 public T Remove(T t) throws NoSuchElementException, IllegalArgumentException {
34 return null;
35 }
36
37 @Override
38 public ISet<T> Intersect(ISet<T> otherSet) throws IllegalArgumentException {
39 return null;
40 }
41
42 @Override
43 public Iterable<T> Values() {
44 return null;
45 }
46
47 @Override
48 public Iterable<T> OrderedValues(boolean firstToLast) {
49 return null;
50 }
51
52 @Override
53 public Integer Size() {
54 return store.size();
55 }
56}
57
58public class FoodPandaTest {
59 @Test

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected