### Question:
IterableUtils { public static <T> boolean contains(Iterable<T> iterable, T object) { if (iterable instanceof Collection) { return ((Collection) iterable).contains(object); } for (T t : iterable) { if (t.equals(object)) { return true; } } return false; } private  IterableUtils(); static long countNodes(GraphDatabaseService database); static long count(Iterable iterable); static boolean contains(Iterable<T> iterable, T object); static List<T> toList(Iterable<T> iterable); static T random(Iterable<T> iterable); static Iterable<T> random(Iterable<T> iterable, int numberOfSamples); static T getSingle(Iterator<T> iterator, String notFoundMessage); static T getSingle(Iterable<T> iterable, String notFoundMessage); static T getSingle(Iterator<T> iterator); static T getSingle(Iterable<T> iterable); static T getSingleOrNull(Iterator<T> iterator); static T getSingleOrNull(Iterable<T> iterable); static T getFirst(Iterator<T> iterator, String notFoundMessage); static T getFirst(Iterable<T> iterable, String notFoundMessage); static T getFirstOrNull(Iterator<T> iterator); static T getFirstOrNull(Iterable<T> iterable);  }### Answer:
@Test public void checkContainsCollections() { assertTrue(contains(asList("a", "b"), "b")); assertFalse(contains(asList("a", "b"), "c")); }
@Test public void checkContainsRealIterables() { Node node; try (Transaction tx = database.beginTx()) { node = database.createNode(); tx.success(); } try (Transaction tx = database.beginTx()) { assertTrue(contains(database.getAllNodes(), node)); } try (Transaction tx = database.beginTx()) { database.getNodeById(0).delete(); tx.success(); } try (Transaction tx = database.beginTx()) { assertFalse(contains(database.getAllNodes(), node)); } }