package com.github.davidmoten.rtree;

import static org.junit.Assert.assertFalse;

import org.junit.Test;

import com.github.davidmoten.util.ObjectsHelper;

public class ObjectsHelperTest {

    @Test
    public void testAsClassIsAbsentIfNull() {
        assertFalse(ObjectsHelper.asClass(null, Integer.class).isPresent());
    }

    @Test
    public void testAsClassIsAbsentIfDifferentClass() {
        assertFalse(ObjectsHelper.asClass(1, String.class).isPresent());
    }
}

@@ -74,16 +74,59 @@
 rtFalse;
+%0Aimport static org.junit.Assert.assertTrue;
 %0A%0Aimport
@@ -511,11 +511,162 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void testAsClassIsPresentIfSameTypeAndNotNull() %7B%0A        assertTrue(ObjectsHelper.asClass(1, Integer.class).isPresent());%0A    %7D
 %0A%7D%0A

add test for ObjectsHelper