docs: private static <X> Predicate<X> isCandidate(final Iterable<List<X>> remainingInputs) {
          return new Predicate<X>() {
  
              Predicate<List<X>> headIs(final X c) {
                  return new Predicate<List<X>>() {
                      public boolean apply(List<X> input) {
                          return !input.isEmpty() && c.equals(input.get(0));
                      }
                  };
              }
  
              Predicate<List<X>> tailContains(final X c) {
                  return new Predicate<List<X>>() {
                      public boolean apply(List<X> input) {
                          return input.indexOf(c) > 0;
                      }
                  };
               }
  
               public boolean apply(final X c) {
                   return any(remainingInputs, headIs(c)) &&
                         all(remainingInputs, not(tailContains(c)));
               }
          };
      }