@Test public void asList() { String[] expected = new String[] { "A", "B", "C" }; Iterable<String> iterable = Arrays.asList( expected ); List<String> actual = Iterables.asList( iterable ); assertThat( actual ) .isNotSameAs( iterable ) .containsExactly( expected ); }
public static <T> List<T> asList( Iterable<T> iterable ) { checkArgument( iterable != null, ITERABLE_MUST_NOT_BE_NULL ); List<T> result = new ArrayList<>(); for( T element : iterable ) { result.add( element ); } return result; }
Iterables { public static <T> List<T> asList( Iterable<T> iterable ) { checkArgument( iterable != null, ITERABLE_MUST_NOT_BE_NULL ); List<T> result = new ArrayList<>(); for( T element : iterable ) { result.add( element ); } return result; } }
Iterables { public static <T> List<T> asList( Iterable<T> iterable ) { checkArgument( iterable != null, ITERABLE_MUST_NOT_BE_NULL ); List<T> result = new ArrayList<>(); for( T element : iterable ) { result.add( element ); } return result; } private  Iterables(); }
Iterables { public static <T> List<T> asList( Iterable<T> iterable ) { checkArgument( iterable != null, ITERABLE_MUST_NOT_BE_NULL ); List<T> result = new ArrayList<>(); for( T element : iterable ) { result.add( element ); } return result; } private  Iterables(); static List<T> asList( Iterable<T> iterable ); }
Iterables { public static <T> List<T> asList( Iterable<T> iterable ) { checkArgument( iterable != null, ITERABLE_MUST_NOT_BE_NULL ); List<T> result = new ArrayList<>(); for( T element : iterable ) { result.add( element ); } return result; } private  Iterables(); static List<T> asList( Iterable<T> iterable );  }