  We establish nearly optimal sample complexity bounds for testing the
$\rho$-clique property in the dense graph model. Specifically, we show that it
is possible to distinguish graphs on $n$ vertices that have a $\rho n$-clique
from graphs for which at least $\epsilon n^2$ edges must be added to form a
$\rho n$-clique by sampling and inspecting a random subgraph on only
$\tilde{O}(\rho^3/\epsilon^2)$ vertices.
  We also establish new sample complexity bounds for $\epsilon$-testing
$k$-colorability. In this case, we show that a sampled subgraph on
$\tilde{O}(k/\epsilon)$ vertices suffices to distinguish $k$-colorable graphs
from those for which any $k$-coloring of the vertices causes at least $\epsilon
n^2$ edges to be monochromatic.
  The new bounds for testing the $\rho$-clique and $k$-colorability properties
are both obtained via new extensions of the graph container method. This method
has been an effective tool for tackling various problems in graph theory and
combinatorics. Our results demonstrate that it is also a powerful tool for the
analysis of property testing algorithms.
