Migrate boxWithJava tests to multi-file framework
This commit is contained in:
+24
@@ -0,0 +1,24 @@
|
||||
// FILE: Box.java
|
||||
|
||||
public class Box<T> {
|
||||
private final T value;
|
||||
|
||||
public Box(T value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public static <T> Box<T> create(T defaultValue) {
|
||||
return new Box(defaultValue);
|
||||
}
|
||||
|
||||
public T getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
fun box(): String {
|
||||
val sub = Box<Long>(-1)
|
||||
return if (sub.value == -1L) "OK" else "fail"
|
||||
}
|
||||
Reference in New Issue
Block a user