Add state pattern to Java folder