Aggregates the contents of n strings into a single list of tuples.

@param inputs A list of strings.
@return A list of strings if none of the strings in the input is null or empty.
An empty list otherwise.
489205
public static List<String> zip(String... inputs) {
        if (inputs.length == 0) {
            return Collections.emptyList();
        }
        OptionalInt min = Arrays.stream(inputs).mapToInt(str -> str == null ? 0 : str.length()).min();
        if (!min.isPresent()) {
            return Collections.emptyList();
        }
        return IntStream.range(0, min.getAsInt())
                .mapToObj(elementIndex -> Arrays.stream(inputs)
                        .map(input -> String.valueOf(input.charAt(elementIndex)))
                        .collect(joining()))
                .collect(toList());
    }
844495
public static Matcher<String> containsStrings(String... strings) {
        List<Matcher<? super String>> matchers = new ArrayList<Matcher<? super String>>();
        for (String string : strings) {
            matchers.add(containsString(string));
        }
        return allOf(matchers);
    }
1079636
public String[] seg(String input){
		if(seg==null)
			return null;
		return seg.tag2Array(input);
	}
217605
public List<Object> parse(final String input, final List<String> operators) {
		final List<Object> result = new ArrayList<Object>();
		if (operators.size() != 0) {
			final boolean innerLoop = operators.size() == 1;
			final MiniParser currentParser = innerLoop ? INNER_MINI_PARSER
					: MINI_PARSER;
			final String operator = operators.get(0);
			final List<String> segments;
			if (operator.length() == 1) {
				segments = currentParser.split(input, operator.charAt(0));
			} else if (operator.length() == 2) {

				List<String> allSegments = currentParser.scan(input, String
						.valueOf(operator.charAt(0)), String.valueOf(operator
						.charAt(1)), true);
				if (allSegments.size() > 0) {
					// the first part is not processed any further
					result.add(allSegments.get(0));
				}
				if (allSegments.size() > 1) {
					segments = allSegments.subList(1, allSegments.size());
				} else {
					segments = Collections.emptyList();
				}

			} else {
				throw new IllegalArgumentException(
						"Operators must either be start/end pairs or single characters");

			}
			if (innerLoop) {
				result.addAll(segments);
			} else {
				for (String segment : segments) {
					List<Object> parse = parse(segment, operators.subList(1,
							operators.size()));
					if (parse.size() == 1 && parse.get(0) instanceof String) {
						result.add(parse.get(0));
					} else {
						result.add(parse);
					}
				}
			}
		}
		return result;
	}
714629
public static FilterParams fromTuples(Object... tuples) {
		StringValueMap map = StringValueMap.fromTuplesArray(tuples);
		return new FilterParams(map);
	}
1136626
public static List<String> readLines(InputStream input) throws IOException {
        final InputStreamReader reader = new InputStreamReader(input);
        return readLines(reader);
    }
19425
private static List<Path> expandMultiAppInputDirs(List<Path> input)
    {
        List<Path> expanded = new LinkedList<>();
        for (Path path : input)
        {
            if (Files.isRegularFile(path))
            {
                expanded.add(path);
                continue;
            }
            if (!Files.isDirectory(path))
            {
                String pathString = (path == null) ? "" : path.toString(); 
                log.warning("Neither a file or directory found in input: " + pathString);
                continue;
            }

            try
            {
                try (DirectoryStream<Path> directoryStream = Files.newDirectoryStream(path))
                {
                    for (Path subpath : directoryStream)
                    {

                        if (isJavaArchive(subpath))
                        {
                            expanded.add(subpath);
                        }
                    }
                }
            }
            catch (IOException e)
            {
                throw new WindupException("Failed to read directory contents of: " + path);
            }
        }
        return expanded;
    }
897218
public static String[] arrayFromStringList(List<String> strings) {

        String[] result = new String[strings.size()];
        for (int i = 0; i < strings.size(); i++) {
            result[i] = strings.get(i);
        }
        return result;
    }
1095358
public String prepare(String input) {
		StringBuffer sb = new StringBuffer();
		for (int i = 0; i < input.length(); i++){
		    char c = input.charAt(i);        
		    if(map.get(c) != null) {
		    	replacements++;
		    	sb.append(map.get(c));
		    } else
		    	sb.append(c);
		}
		return sb.toString();
	}
1318354
public static Double[] asDoubleArray(List<Double> input) {
		Double[] result = new Double[input.size()];

		for (int i = 0; i < result.length; i++) {
			result[i] = input.get(i);
		}

		return result;
	}
1302670
public ManParameter parseParams(List<String> input, int columns) {
        out.add(argPad+ManParserUtil.convertStringToAnsi(input.get(0)));
        input.remove(0);
        if(!input.isEmpty()) {
            StringBuilder builder = new StringBuilder();
            for(String in : input) {
               if(in.trim().length() > 0)
                   builder.append(in.trim()).append(' ');
            }

            if(builder.length() > 0) {
               for(String s : Parser.splitBySizeKeepWords(builder.toString(), columns - textPad.length())) {
                  out.add(textPad+ManParserUtil.convertStringToAnsi(s));
               }
            }
            //add an empty line at the bottom to create a line separator between params
            if(out.size() > 0)
                out.add(" ");
        }
        return this;
    }
855727
public static String join(String[] input, char separator) {
        //simple case, no escaping
        StringBuilder stringBuilder = new StringBuilder();
        for (String s : input) {
            if (stringBuilder.length() > 0) {
                stringBuilder.append(separator);
            }
            stringBuilder.append(s);
        }
        return stringBuilder.toString();
    }
1236853
public static UTF8String concat(UTF8String... inputs) {
    // Compute the total length of the result.
    long totalLength = 0;
    for (int i = 0; i < inputs.length; i++) {
      if (inputs[i] != null) {
        totalLength += (long)inputs[i].numBytes;
      } else {
        return null;
      }
    }

    // Allocate a new byte array, and copy the inputs one by one into it.
    final byte[] result = new byte[Ints.checkedCast(totalLength)];
    int offset = 0;
    for (int i = 0; i < inputs.length; i++) {
      int len = inputs[i].numBytes;
      copyMemory(
        inputs[i].base, inputs[i].offset,
        result, BYTE_ARRAY_OFFSET + offset,
        len);
      offset += len;
    }
    return fromBytes(result);
  }
618179
public static String[] merge(final String[] input, final String[] list) {
        final List<String> v = new ArrayList<String>(Arrays.asList(list));
        for (final String anInput : input) {
            if ((null != anInput) && !v.contains(anInput)) {
                v.add(anInput);
            }
        }
        return v.toArray(new String[v.size()]);
    }
625329
public static <T> List<T> subList(List<T> input, int startIndex, int count) {
        int fromIndex = startIndex - 1;
        int toIndex = fromIndex + count;
        if (toIndex >= input.size()) {
            toIndex = input.size();
        }
        if (fromIndex >= toIndex) {
            return Collections.emptyList();
        }
        return input.subList(fromIndex, toIndex);
    }
763810
public static String trim(CharSequence input) {
      if (input == null) {
         return null;
      }
      return StringFunctions.TRIM.apply(input.toString());
   }
476030
public static List<String> split(String input) {
        List<String> result = new ArrayList<>();
        StringBuilder cur = new StringBuilder();
        State state = State.START_FIELD;

        for (int i = 0; i < input.length(); i++) {
            char ch = input.charAt(i);
            switch (ch) {
                case ',':
                    switch (state) {
                        case IN_QFIELD:
                            cur.append(',');
                            break;
                        default:
                            result.add(cur.toString());
                            cur.setLength(0);
                            state = State.START_FIELD;
                            break;
                    }
                    break;
                case '"':
                    switch (state) {
                        case START_FIELD:
                            state = State.IN_QFIELD;
                            break;
                        case IN_QFIELD:
                            state = State.END_QFIELD;
                            break;
                        case IN_FIELD:
                            throw new CSVParseException("unexpected quote", input, i);
                        case END_QFIELD:
                            cur.append('"');
                            state = State.IN_QFIELD;
                            break;
                    }
                    break;
                default:
                    switch (state) {
                        case START_FIELD:
                            state = State.IN_FIELD;
                            break;
                        case IN_FIELD:
                        case IN_QFIELD:
                            break;
                        case END_QFIELD:
                            throw new CSVParseException("extra character after quoted string",
                                                        input, i);
                    }
                    cur.append(ch);
                    break;
            }
        }

        if (state == State.IN_QFIELD) {
            throw new CSVParseException("unclosed quote", input, input.length());
        }

        result.add(cur.toString());
        return result;
    }