code: protected static Class<?> checkTarget(GVRHybridObject target,
              Class<?>... supported) {
          for (Class<?> type : supported) {
              if (type.isInstance(target)) {
                  return type;
              }
          }
          // else
          throw new IllegalArgumentException();
      }
docs: Many animations can take multiple target types: for example,
  {@link GVRMaterialAnimation material animations} can work directly with
  {@link GVRMaterial} targets, but also 'know how' to get a
  {@link GVRMaterial} from a {@link GVRSceneObject}. They can, of course,
  just expose multiple constructors, but that makes for a combinatorial
  explosion when the other parameters also 'want' to be overloaded. This
  method allows them to just take a {@link GVRHybridObject} and throw an
  exception if they get a type they can't handle; it also returns the
  matched type (which may not be equal to {@code target.getClass()}) so
  that calling code doesn't have to do {@code instanceof} tests.
  
  @param target
  A {@link GVRHybridObject} instance
  @param supported
  An array of supported types
  @return The element of {@code supported} that matched
  @throws IllegalArgumentException
  If {@code target} is not an instance of any of the
  {@code supported} types