Пример #1
0
 /**
  * Returns a NonEmptyList of the sublists of this list.
  *
  * @return a NonEmptyList of the sublists of this list.
  */
 public NonEmptyList<NonEmptyList<A>> sublists() {
   return fromList(
           somes(
               toList()
                   .toStream()
                   .substreams()
                   .map(F1Functions.o(list -> fromList(list), Conversions.<A>Stream_List()))
                   .toList()))
       .some();
 }
Пример #2
0
 /**
  * Returns a NonEmptyList of the sublists of this list.
  *
  * @return a NonEmptyList of the sublists of this list.
  */
 public NonEmptyList<NonEmptyList<A>> sublists() {
   return fromList(
           somes(
               toList()
                   .toStream()
                   .substreams()
                   .map(
                       F1Functions.o(
                           new F<List<A>, Option<NonEmptyList<A>>>() {
                             public Option<NonEmptyList<A>> f(final List<A> list) {
                               return fromList(list);
                             }
                           },
                           Conversions.<A>Stream_List()))
                   .toList()))
       .some();
 }