@@ -0,0 +1,1154 @@
+package laughinglen.control;%0A%0Aimport org.junit.Test;%0A%0Aimport static org.hamcrest.CoreMatchers.is;%0Aimport static org.junit.Assert.assertThat;%0A%0Apublic class ControlsTest %7B%0A%0A%09@Test%0A%09public void shouldAlwaysBeActive() %7B%0A%09%09final Control control = Controls.active();%0A%0A%09%09assertThat(control.current().active, is(true));%0A%0A%09%09final Flags flags = new Flags();%0A%09%09control.changes().subscribe(%0A%09%09%09%09state -%3E flags.received = true,%0A%09%09%09%09throwable -%3E flags.errors = true,%0A%09%09%09%09() -%3E flags.completed = true%0A%09%09);%0A%0A%09%09assertThat(flags.received, is(false));%0A%09%09assertThat(flags.errors, is(false));%0A%09%09assertThat(flags.completed, is(true));%0A%09%7D%0A%0A%09@Test%0A%09public void shouldAlwaysBeInactive() %7B%0A%09%09final Control control = Controls.inactive();%0A%0A%09%09assertThat(control.current().active, is(false));%0A%0A%09%09final Flags flags = new Flags();%0A%09%09control.changes().subscribe(%0A%09%09%09%09state -%3E flags.received = true,%0A%09%09%09%09throwable -%3E flags.errors = true,%0A%09%09%09%09() -%3E flags.completed = true%0A%09%09);%0A%0A%09%09assertThat(flags.received, is(false));%0A%09%09assertThat(flags.errors, is(false));%0A%09%09assertThat(flags.completed, is(true));%0A%09%7D%0A%0A%09private class Flags %7B%0A%09%09boolean received;%0A%09%09boolean errors;%0A%09%09boolean completed;%0A%09%7D%0A%7D

Add test for Controls