### Question:
RingGroupConductor { void processUpdates(RingGroup ringGroup) throws IOException { if (ringGroup.getRingGroupConductorMode() == RingGroupConductorMode.ACTIVE || ringGroup.getRingGroupConductorMode() == RingGroupConductorMode.PROACTIVE || ringGroup.getRingGroupConductorMode() == RingGroupConductorMode.AUTOCONFIGURE) { updateTransFunc.manageTransitions(coordinator, ringGroup); } } RingGroupConductor(RingGroupConductorConfigurator configurator);   RingGroupConductor(RingGroupConductorConfigurator configurator,
                     RingGroupTransitionFunction updateTransFunc,
                     RingGroupTransitionFunction configureTransFunc); void run(); static void main(String[] args); void stop();  }### Answer:
@Test public void testTriggersUpdates() throws Exception { final MockDomain domain = new MockDomain("domain") { @Override public DomainVersion getVersion(int version) { return new MockDomainVersion(0, 0l); } }; final MockDomainGroup domainGroup = new MockDomainGroup("myDomainGroup") { @Override public Set<DomainAndVersion> getDomainVersions() { SortedSet<DomainAndVersion> result = new TreeSet<DomainAndVersion>(); result.add(new DomainAndVersion(domain, 1)); return result; } }; final MockHostDomainPartition mockHostDomainPartition = new MockHostDomainPartition(0, 0); final MockHost mockHost = new MockHost(new PartitionServerAddress("locahost", 12345)) { @Override public Set<HostDomain> getAssignedDomains() throws IOException { return Collections.singleton((HostDomain)new MockHostDomain(domain) { @Override public HostDomainPartition addPartition(int partitionNumber) { return null; } @Override public Set<HostDomainPartition> getPartitions() { return Collections.singleton((HostDomainPartition)mockHostDomainPartition); } }); } }; final MockRing mockRing = new MockRing(null, null, 1) { @Override public Set<Host> getHosts() { return Collections.singleton((Host)mockHost); } }; final MockRingGroup mockRingGroup = new MockRingGroup(null, "myRingGroup", Collections.<Ring>emptySet()) { @Override public DomainGroup getDomainGroup() { return domainGroup; } @Override public Set<Ring> getRings() { return Collections.singleton((Ring)mockRing); } @Override public RingGroupConductorMode getRingGroupConductorMode() { return RingGroupConductorMode.ACTIVE; } }; RingGroupConductorConfigurator mockConfig = new RingGroupConductorConfigurator() { @Override public long getSleepInterval() { return 100; } @Override public RingGroupConductorMode getInitialMode() { return RingGroupConductorMode.ACTIVE; } @Override public Integer getTargetHostsPerRing() { return null; } @Override public List<RingGroupConfiguredDomain> getConfiguredDomains() { return Lists.newArrayList(); } @Override public int getMinRingFullyServingObservations() { return 0; } @Override public String getHostAvailabilityBucketFlag() { return null; } @Override public int getMinServingReplicas() { return 2; } @Override public int getAvailabilityBucketMinServingReplicas() { return 0; } @Override public double getMinServingFraction() { return 0; } @Override public double getMinAvailabilityBucketServingFraction() { return 0; } @Override public String getRingGroupName() { return "myRingGroup"; } @Override public Coordinator createCoordinator() { return new MockCoordinator() { @Override public RingGroup getRingGroup(String ringGroupName) { return mockRingGroup; } }; } }; MockRingGroupUpdateTransitionFunction mockTransFunc = new MockRingGroupUpdateTransitionFunction(); RingGroupConductor daemon = new RingGroupConductor(mockConfig, mockTransFunc, new NoOpRingGroupTransitionFunction()); daemon.processUpdates(mockRingGroup); assertNotNull(mockTransFunc.calledWithRingGroup); }