22
22
import com .google .common .collect .Multimap ;
23
23
import com .google .common .collect .Multiset ;
24
24
import com .google .common .collect .Table ;
25
+ import com .google .j2objc .annotations .J2ObjCIncompatible ;
25
26
import java .math .BigDecimal ;
27
+ import java .nio .file .Path ;
26
28
import java .util .Map ;
27
29
import java .util .Optional ;
30
+ import java .util .OptionalDouble ;
31
+ import java .util .OptionalInt ;
32
+ import java .util .OptionalLong ;
33
+ import java .util .stream .IntStream ;
34
+ import java .util .stream .LongStream ;
28
35
import java .util .stream .Stream ;
29
36
import org .checkerframework .checker .nullness .qual .Nullable ;
30
37
@@ -182,6 +189,36 @@ public final OptionalSubject that(@Nullable Optional<?> actual) {
182
189
return new OptionalSubject (metadata (), actual , "optional" );
183
190
}
184
191
192
+ /**
193
+ * @since 1.4.0 (with access to {@link OptionalIntSubject} previously part of {@code
194
+ * truth-java8-extension})
195
+ */
196
+ @ SuppressWarnings (
197
+ "Java7ApiChecker" ) // no more dangerous that wherever the user got the OptionalInt
198
+ public final OptionalIntSubject that (@ Nullable OptionalInt actual ) {
199
+ return new OptionalIntSubject (metadata (), actual , "optionalInt" );
200
+ }
201
+
202
+ /**
203
+ * @since 1.4.0 (with access to {@link OptionalLongSubject} previously part of {@code
204
+ * truth-java8-extension})
205
+ */
206
+ @ SuppressWarnings (
207
+ "Java7ApiChecker" ) // no more dangerous that wherever the user got the OptionalLong
208
+ public final OptionalLongSubject that (@ Nullable OptionalLong actual ) {
209
+ return new OptionalLongSubject (metadata (), actual , "optionalLong" );
210
+ }
211
+
212
+ /**
213
+ * @since 1.4.0 (with access to {@link OptionalDoubleSubject} previously part of {@code
214
+ * truth-java8-extension})
215
+ */
216
+ @ SuppressWarnings (
217
+ "Java7ApiChecker" ) // no more dangerous that wherever the user got the OptionalDouble
218
+ public final OptionalDoubleSubject that (@ Nullable OptionalDouble actual ) {
219
+ return new OptionalDoubleSubject (metadata (), actual , "optionalDouble" );
220
+ }
221
+
185
222
/**
186
223
* @since 1.3.0 (with access to {@link StreamSubject} previously part of {@code
187
224
* truth-java8-extension})
@@ -191,6 +228,38 @@ public final StreamSubject that(@Nullable Stream<?> actual) {
191
228
return new StreamSubject (metadata (), actual );
192
229
}
193
230
231
+ /**
232
+ * @since 1.4.0 (with access to {@link IntStreamSubject} previously part of {@code
233
+ * truth-java8-extension})
234
+ */
235
+ @ SuppressWarnings ("Java7ApiChecker" ) // no more dangerous that wherever the user got the IntStream
236
+ public final IntStreamSubject that (@ Nullable IntStream actual ) {
237
+ return new IntStreamSubject (metadata (), actual );
238
+ }
239
+
240
+ /**
241
+ * @since 1.4.0 (with access to {@link LongStreamSubject} previously part of {@code
242
+ * truth-java8-extension})
243
+ */
244
+ @ SuppressWarnings (
245
+ "Java7ApiChecker" ) // no more dangerous that wherever the user got the LongStream
246
+ public final LongStreamSubject that (@ Nullable LongStream actual ) {
247
+ return new LongStreamSubject (metadata (), actual );
248
+ }
249
+
250
+ // TODO(b/64757353): Add support for DoubleStream?
251
+
252
+ /**
253
+ * @since 1.4.0 (with access to {@link PathSubject} previously part of {@code
254
+ * truth-java8-extension})
255
+ */
256
+ @ GwtIncompatible
257
+ @ J2ObjCIncompatible
258
+ @ J2ktIncompatible
259
+ public final PathSubject that (@ Nullable Path actual ) {
260
+ return new PathSubject (metadata (), actual );
261
+ }
262
+
194
263
/**
195
264
* Returns a new instance that will output the given message before the main failure message. If
196
265
* this method is called multiple times, the messages will appear in the order that they were
0 commit comments