class WatekKlienta extends Thread {
     private static int sumaKlientow = 0;
     
     public static WatekKlienta getInstance(Socket klient) {
          System.gc();
          if (sumaKlientow <= 100) {
               ++sumaKlientow;
               return new WatekKlienta(klient);
          }
          return null;
     }

     private WatekKlienta(Socket klient) {
          // Kod konstruktora
     }

     public finalize() {
          --sumaKlientow;
     }
}
