code: public static <T> PartitionIterable<T> partition(Iterable<T> iterable, Predicate<? super T> predicate)
      {
          if (iterable instanceof RichIterable<?>)
          {
              return ((RichIterable<T>) iterable).partition(predicate);
          }
          if (iterable instanceof ArrayList)
          {
              return ArrayListIterate.partition((ArrayList<T>) iterable, predicate);
          }
          if (iterable instanceof List)
          {
              return ListIterate.partition((List<T>) iterable, predicate);
          }
          if (iterable != null)
          {
              return IterableIterate.partition(iterable, predicate);
          }
          throw new IllegalArgumentException("Cannot perform a partition on null");
      }
docs: Filters a collection into a PartitionIterable based on a predicate.
  <p>
  Example using a Java 8 lambda expression:
  <pre>
  PartitionIterable&lt;Person&gt; newYorkersAndNonNewYorkers =
  Iterate.<b>partition</b>(people, person -> person.getAddress().getState().getName().equals("New York"));
  </pre>
  <p>
  Example using an anonymous inner class:
  <pre>
  PartitionIterable&lt;Person&gt; newYorkersAndNonNewYorkers =
  Iterate.<b>partition</b>(people, new Predicate&lt;Person&gt;()
  {
  public boolean value(Person person)
  {
  return person.getAddress().getState().getName().equals("New York");
  }
  });
  </pre>