Instances implements Iterable<Instance> { public Iterator<Instance> iterator() { return iterator(getDefaultProjectName()); } Instances(Odps odps); String getDefaultRunningCluster(); void setDefaultRunningCluster(String defaultRunningCluster); Instance create(Job job); Instance create(Task task); Instance create(Task task, int priority); Instance create(Task task, int priority, String runningCluster); Instance get(String id); Instance get(String projectName, String id); boolean exists(String id); boolean exists(String projectName, String id); Instance create(String projectName, Task task); Instance create(String projectName, Task task, int priority); Instance create(String projectName, Task task, int priority, String runningCluster); Instance create(String projectName, Task task, Integer priority, String runningCluster); Instance create(String projectName, Task task, Integer priority, String runningCluster,
                         String jobName); Iterator<Instance> iterator(); Iterator<Instance> iterator(final String project); Iterator<Instance> iterator(final InstanceFilter filter); Iterator<Instance> iterator(final String project,
                                     final InstanceFilter filter); Iterable<Instance> iterable(); Iterable<Instance> iterable(final String project); Iterable<Instance> iterable(final InstanceFilter filter); Iterable<Instance> iterable(final String project,
                                     final InstanceFilter filter); Iterator<Instance.InstanceQueueingInfo> iteratorQueueing(); Iterator<Instance.InstanceQueueingInfo> iteratorQueueing(String project); Iterator<Instance.InstanceQueueingInfo> iteratorQueueing(InstanceFilter filter); Iterator<Instance.InstanceQueueingInfo> iteratorQueueing(String project, InstanceFilter filter); Iterator<Instance.InstanceQueueingInfo> iteratorQueueing(
      String project, InstanceFilter filter, Integer maxItemsPerRequest);  }
@Test public void testIterator() throws FileNotFoundException { Iterator<Instance> iterator = odps.instances().iterator(); if (iterator.hasNext()) { iterator.next().getId(); } }