class K2JCompat {

    public static <T> K2JWrapper<T> take(T object) {
        return new K2JWrapper<>(object);
    }

}

class K2JCompatTest {

    @Test
    public void takeUnless_nullInput_returnsNullIfTrue() {

        final AtomicBoolean takeUnlessCalled = new AtomicBoolean(false);

        final SimpleClass returned = take((SimpleClass) null)
                .takeUnless((in) -> {
                    takeUnlessCalled.set(true);
                    return true;
                })
                .unwrap();

        Assert.assertTrue(takeUnlessCalled.get());
        Assert.assertNull(returned);
    }

}