()
| 53 | } |
| 54 | |
| 55 | @Test |
| 56 | void emptyValueOf() throws Exception { |
| 57 | assertThat(Util.emptyValueOf(boolean.class)).isEqualTo(false); |
| 58 | assertThat(Util.emptyValueOf(Boolean.class)).isEqualTo(false); |
| 59 | assertThat((byte[]) Util.emptyValueOf(byte[].class)).isEmpty(); |
| 60 | assertThat(Util.emptyValueOf(Collection.class)).isEqualTo(Collections.emptyList()); |
| 61 | assertThat(((Iterator<?>) Util.emptyValueOf(Iterator.class)).hasNext()).isFalse(); |
| 62 | assertThat(Util.emptyValueOf(List.class)).isEqualTo(Collections.emptyList()); |
| 63 | assertThat(Util.emptyValueOf(Map.class)).isEqualTo(Collections.emptyMap()); |
| 64 | assertThat(Util.emptyValueOf(Set.class)).isEqualTo(Collections.emptySet()); |
| 65 | assertThat(Util.emptyValueOf(Optional.class)).isEqualTo(Optional.empty()); |
| 66 | } |
| 67 | |
| 68 | /** In other words, {@code List<String>} is as empty as {@code List<?>}. */ |
| 69 | @Test |
nothing calls this directly
no test coverage detected