code: public static AminoAcidSequence translate(NucleotideSequence sequence) {
          if (sequence.size() % 3 != 0)
              throw new IllegalArgumentException("Only nucleotide sequences with size multiple " +
                      "of three are supported (in-frame).");
          byte[] aaData = new byte[sequence.size() / 3];
          GeneticCode.translate(aaData, 0, sequence, 0, sequence.size());
          return new AminoAcidSequence(aaData, true);
      }
docs: Translates sequence having length divisible by 3, starting from first nucleotide.
  
  @param sequence nucleotide sequence
  @return translated amino acid sequence