add State class / test cases added

Signed-off-by: owwlo <owwlo@163.com>