/**
 * Copyright (C) 2015 The Authors.
 */
package dk.itu.kelvin.util;

// General utilities
import java.util.Arrays;
import java.util.Comparator;

/**
 * Collections class.
 *
 * @version 1.0.0
 */
public final class Collections {
  /**
   * Sort a list of comparable elements.
   *
   * <p>
   * The list will be sorted in-place.
   *
   * @param list The list of comparable elements to sort.
   */
  @SuppressWarnings("unchecked")
  public static <T extends Comparable<? super T>> void sort(
    final List<T> list
  ) {
    T[] elements = (T[]) list.toArray();

    Arrays.sort(elements);

    for (int i = 0; i < elements.length; i++) {
      list.set(i, elements[i]);
    }
  }

  /**
   * Sort a list of elements using the specified comparator.
   *
   * <p>
   * The list will be sorted in-place.
   *
   * @param list        The list of elements to sort.
   * @param comparator  The comparator to use for sorting the list.
   */
  @SuppressWarnings("unchecked")
  public static <T> void sort(
    final List<T> list,
    final Comparator<? super T> comparator
  ) {
    T[] elements = (T[]) list.toArray();

    Arrays.sort(elements, comparator);

    for (int i = 0; i < elements.length; i++) {
      list.set(i, elements[i]);
    }
  }
}

@@ -225,16 +225,531 @@
 tions %7B%0A
+  /**%0A   * Don't allow instantiation of the class.%0A   *%0A   * %3Cp%3E%0A   * Since the class only contains static fields and methods, we never want to%0A   * instantiate the class. We therefore define a private constructor so that%0A   * noone can create instances of the class other than the class itself.%0A   *%0A   * %3Cp%3E%0A   * NB: This does not make the class a singleton. In fact, there never exists%0A   * an instance of the class since not even the class instantiates itself.%0A   */%0A  private Collections() %7B%0A    super();%0A  %7D%0A%0A
   /**%0A  
@@ -837,32 +837,80 @@
  in-place.%0A   *%0A
+   * @param %3CT%3E   The type of elements to sort.%0A
    * @param list
@@ -910,16 +910,17 @@
 am list 
+ 
 The list
@@ -1359,32 +1359,86 @@
  in-place.%0A   *%0A
+   * @param %3CT%3E         The type of elements to sort.%0A
    * @param list

Fix code style issues.