use of jcog.Service in project narchy by automenta.
the class NARServiceTest method testRemoveDurServiceWhenOff.
@Test
public void testRemoveDurServiceWhenOff() {
NAR n = NARS.shell();
Set<Service<NAR>> before = n.services.stream().collect(toSet());
DurService d = DurService.on(n, () -> {
// nothing
});
n.synch();
Set<Service<NAR>> during = n.services.stream().collect(toSet());
d.off();
n.synch();
Set<Service<NAR>> after = n.services.stream().collect(toSet());
assertEquals(before, after);
assertEquals(before.size() + 1, during.size());
}