private static boolean checkUnique(final int[] indices){
  final Set<Integer> indicesSet=new HashSet<Integer>();
  for (  int index : indices)   indicesSet.add(index);
  return indices.length == indicesSet.size();
}

private static boolean checkUnique ( final int [ ] indices ) { final Set < Integer > indicesSet = new HashSet < Integer > ( ) ; for ( int index : indices ) indicesSet . add ( index ) ; return indices . length == indicesSet . size ( ) ; }
checks that the given indices are unique .
