/* (non-Javadoc)
@see io.jsondb.JsonDBOperations#collectionExists(java.lang.Class)
19931
@Override
  public <T> boolean collectionExists(Class<T> entityClass) {
    return collectionExists(Util.determineCollectionName(entityClass));
  }
231575
protected void checkCollectionType(Collection c) {
        if (type != null) {
            for (Iterator iter = c.iterator(); iter.hasNext(); ) {
                Object element = iter.next();
                checkType(element);
            }
        }
    }
829506
@GetMapping(value = "/{entityTypeId}/exist", produces = APPLICATION_JSON_VALUE)
  public boolean entityExists(@PathVariable("entityTypeId") String entityTypeId) {
    return dataService.hasRepository(entityTypeId);
  }
434505
@Override
	public boolean containsAll(Collection<?> collection) {
		if (booleanTerms == null) {
			return false;
		}
		return booleanTerms.containsAll(collection);
	}
287851
private boolean contractAlreadyExists(String organizationId, String clientId, String version,
            NewContractBean bean) {
        try {
            List<ContractSummaryBean> contracts = query.getClientContracts(organizationId, clientId, version);
            for (ContractSummaryBean contract : contracts) {
                if (contract.getApiOrganizationId().equals(bean.getApiOrgId()) &&
                    contract.getApiId().equals(bean.getApiId()) &&
                    contract.getApiVersion().equals(bean.getApiVersion()) &&
                    contract.getPlanId().equals(bean.getPlanId()))
                {
                    return true;
                }
            }
            return false;
        } catch (StorageException e) {
            return false;
        }
    }
830789
private static boolean checkCollectionMembers(Collection<?> c, Class<?> type) {
        for (Object element : c) {
            if (element != null && !type.isInstance(element)) {
                return false;
            }
        }
        return true;
    }
476528
protected final boolean entityExists(final String entityName) {
        final Set<EntityType<?>> entityTypes = getEm().getMetamodel().getEntities();
        for (final EntityType<?> entityType : entityTypes) {
            if (entityType.getName().equals(entityName)) {
                return true;
            }
        }
        return false;
    }
932087
@Override
	public boolean exists(String resource, String[] paths) throws IOException {
		for (ResourceLoader loader : loaders) {
			if (loader.exists(resource, paths)) {
				return true;
			}
		}
		return false;
	}
216005
public boolean containsCheckedExceptions() throws ClassNotFoundException {
        for (ThrownExceptionIterator i = iterator(); i.hasNext();) {
            ObjectType type = i.next();
            if (!Hierarchy.isUncheckedException(type)) {
                return true;
            }
        }
        return false;
    }
1069919
private boolean methodExists(Class clazz, String name) {
        Method[] methods = clazz.getDeclaredMethods();
        for (int i = 0; i < methods.length; i++) {
            if (methods[i].getName().equals(name)) {
                return true;
            }
        }

        if (clazz.getSuperclass() != null
                && methodExists(clazz.getSuperclass(), name)) {
            return true;
        }

        Class[] interfaces = clazz.getInterfaces();
        for (int i = 0; i < interfaces.length; i++) {
            if (methodExists(interfaces[i], name)) {
                return true;
            }
        }

        return false;
    }
553596
private void processClassDescriptorCollection(final Object classDescriptorCollection) {
        if (classDescriptorCollection == null || !isCastable("java.util.Collection", classDescriptorCollection.getClass())) {
            return;
        }

        final Collection<?> c = (Collection<?>) classDescriptorCollection;
        for (Object descriptor : c) {
            processClassDescriptorObject(descriptor);
        }
    }
991902
public boolean containsAll(Collection otherCollection,
                               Transaction transaction)
                    throws ObjectManagerException
    {
        try {
            for (Iterator iterator = otherCollection.iterator(); contains((Token) iterator.next(transaction), transaction););
            return false;
        } catch (java.util.NoSuchElementException exception) {
            // No FFDC code needed.
            return true;
        } // try.
    }
1011154
protected boolean isExist(String rootPackageName, String lastClassName) {
        final Resources[] checkerArray = getExistCheckerArray(rootPackageName);
        for (int i = 0; i < checkerArray.length; ++i) {
            if (checkerArray[i].isExistClass(lastClassName)) {
                return true;
            }
        }
        return false;
    }
136401
@Override
    public boolean contains(Object arg0) {
        checkUnsupportedOperationForIterationOnlyMode("contains(Object arg0)");
        
        if ( allResults.contains(arg0) )
            return true;
        
        while ( nextResultsAvailable() ) {
            boolean found = nextResults.contains(arg0);
            moveNextResults(false);
            if ( found )
                return true;
        }

        return false;
    }
279059
public static <T> boolean containsObject(Collection<T> c, T o) {
    for (Object o1 : c) {
      if (o == o1) {
        return true;
      }
    }
    return false;
  }
1127731
@Override
	public void exists(final Runnable runnable) {
		StringBuilder sql = new StringBuilder("select 1 from (")
				.append(System.lineSeparator())
				.append(aggregationSourceSql())
				.append(System.lineSeparator())
				.append(") t_");
		context().setSql(sql.toString());
		try (ResultSet rs = agent().query(context())) {
			if (rs.next()) {
				runnable.run();
			}
		} catch (final SQLException e) {
			throw new EntitySqlRuntimeException(SqlKind.SELECT, e);
		}
	}
209477
public static void checkClassExists(String className, String msg) {
		try {
			getDefaultClassLoader().loadClass(className);
		} catch (ClassNotFoundException e) {
			throw new WatcherDependencyNotFoundException(msg);
		}
	}