A clustering theorem in fractional Sobolev spaces