package com.github.davidmoten.rtree.internal.util;

public final class ObjectsHelper {

    private ObjectsHelper() {
        // prevent instantiation
    }

    static void instantiateForTestCoveragePurposesOnly() {
        new ObjectsHelper();
    }

    @SuppressWarnings("unchecked")
    public static <T> com.github.davidmoten.guavamini.Optional<T> asClass(Object object,
            Class<T> cls) {
        if (object == null)
            return com.github.davidmoten.guavamini.Optional.absent();
        else if (object.getClass() != cls)
            return com.github.davidmoten.guavamini.Optional.absent();
        else
            return com.github.davidmoten.guavamini.Optional.of((T) object);
    }

}

@@ -45,16 +45,136 @@
 .util;%0A%0A
+import com.github.davidmoten.guavamini.Optional;%0Aimport com.github.davidmoten.guavamini.annotations.VisibleForTesting;%0A%0A
 public f
@@ -267,24 +267,47 @@
 tion%0A    %7D%0A%0A
+    @VisibleForTesting%0A
     static v
@@ -450,40 +450,8 @@
 %3CT%3E 
-com.github.davidmoten.guavamini.
 Opti
@@ -480,28 +480,16 @@
  object,
-%0A           
  Class%3CT
@@ -548,40 +548,8 @@
 urn 
-com.github.davidmoten.guavamini.
 Opti
@@ -629,40 +629,8 @@
 urn 
-com.github.davidmoten.guavamini.
 Opti
@@ -680,40 +680,8 @@
 urn 
-com.github.davidmoten.guavamini.
 Opti

add VisibleForTesting annotation to ObjectsHelper