| 117 | } |
| 118 | |
| 119 | private static class Empty implements Buffer { |
| 120 | public Buffer add(Object o) { |
| 121 | return new Single(o); |
| 122 | } |
| 123 | |
| 124 | public Object remove() { |
| 125 | throw new IllegalStateException("Removing object from empty buffer"); |
| 126 | } |
| 127 | |
| 128 | public boolean isEmpty() { |
| 129 | return true; |
| 130 | } |
| 131 | |
| 132 | public String toString() { |
| 133 | return "Empty"; |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | private static class Single implements Buffer { |
| 138 | private volatile Object val; |
nothing calls this directly
no outgoing calls
no test coverage detected