public static boolean isPrefixFreeCode(final Set<Bits> keySet) {
    final TreeSet<Bits> check = new TreeSet<Bits>();
    for (final Bits code : keySet) {
      final Bits ceiling = check.ceiling(code);
      if (null != ceiling
        && (ceiling.startsWith(code) || code.startsWith(ceiling))) {
        return false;
      }
      final Bits floor = check.floor(code);
      if (null != floor && (floor.startsWith(code) || code.startsWith(floor))) {
        return false;
      }
      check.add(code);
    }
    return true;
  }
public static boolean isPrefixFreeCode ( final Set < Bits > keySet ) { final TreeSet < Bits > check = new TreeSet < Bits > ( ) ; for ( final Bits code : keySet ) { final Bits ceiling = check . ceiling ( code ) ; if ( null != ceiling && ( ceiling . startsWith ( code ) || code . startsWith ( ceiling ) ) ) { return false ; } final Bits floor = check . floor ( code ) ; if ( null != floor && ( floor . startsWith ( code ) || code . startsWith ( floor ) ) ) { return false ; } check . add ( code ) ; } return true ; }
Is prefix free code boolean.

@param keySet the key set
@return the boolean