| 4 | // Visit http://OnJava8.com for more book information. |
| 5 | |
| 6 | public class GenericHolder2<T> { |
| 7 | private T obj; |
| 8 | public void set(T obj) { this.obj = obj; } |
| 9 | public T get() { return obj; } |
| 10 | public static void main(String[] args) { |
| 11 | GenericHolder2<String> holder = |
| 12 | new GenericHolder2<>(); |
| 13 | holder.set("Item"); |
| 14 | String s = holder.get(); |
| 15 | } |
| 16 | } |
nothing calls this directly
no outgoing calls
no test coverage detected