code: private static String formatAddress6(int[] hexRepresentation){
         if(hexRepresentation == null){
             throw new NullPointerException();
         }
         if(hexRepresentation.length != IPV6_LEN){
             throw new IllegalArgumentException();
         }
         StringBuilder stringBuilder = new StringBuilder();
         boolean inCompressedSection = false;
         for(int i = 0;i<hexRepresentation.length;i++){
             if(hexRepresentation[i] == -1){
                 if(!inCompressedSection){
                     inCompressedSection = true;
                     if(i == 0){
                         stringBuilder.append("::");
                     } else {
                         stringBuilder.append(':');
                     }
                 }
             } else {
                 inCompressedSection = false;
                 stringBuilder.append(Integer.toHexString(hexRepresentation[i]));
                 if(i+1<hexRepresentation.length){
                     stringBuilder.append(":");
                 }
             }
         }
         return stringBuilder.toString();
      }
docs: Converts IPV6 int[] representation into valid IPV6 string literal. Sequence of '-1' values are converted into '::'.
  @param hexRepresentation
  @return