code: private static <S extends Sequence<S>> BlastDB build(List<S> sequences, boolean buildIdIndex,
                                                           Path path, boolean tmp) {
          if (sequences.isEmpty())
              throw new IllegalArgumentException("No records.");
  
          if (path == null)
              path = getTmpDBPath();
  
          Alphabet<S> alphabet = sequences.get(0).getAlphabet();
  
          try {
              String name = RandomUtil.getThreadLocalRandomData().nextHexString(40);
              String fullName = path.resolve(name).toString();
              List<String> cmd = new ArrayList<>();
              cmd.addAll(Arrays.asList(Blast.CMD_MAKEBLASTDB, "-dbtype", Blast.toBlastAlphabet(alphabet),
                      "-out", fullName, "-title", name));
              cmd.addAll(Arrays.asList("-parse_seqids", "-hash_index"));
              Process proc = Blast.getProcessBuilder(cmd).start();
              FastaWriter<S> writer = new FastaWriter<>(proc.getOutputStream(), FastaWriter.DEFAULT_MAX_LENGTH);
              for (int i = 0; i < sequences.size(); i++)
                  writer.write(getIdFasta(i), sequences.get(i));
              writer.close();
              String err = IOUtils.toString(proc.getErrorStream(), Charset.forName("US-ASCII"));
              if (proc.waitFor() != 0)
                  throw new RuntimeException("Something goes wrong: " + err);
              return BlastDB.get(fullName, tmp);
          } catch (RuntimeException e) {
              throw e;
          } catch (Exception e) {
              throw new RuntimeException(e);
          }
      }
docs: TODO caching etc..