### Question:
NodeGroup { void downgrade(NodeId id) { logger.info("downgrade node {}", id); GroupMember member = findMember(id); member.setMajor(false); member.setRemoving(); } NodeGroup(NodeEndpoint endpoint);   NodeGroup(Collection<NodeEndpoint> endpoints, NodeId selfId);   }### Answer:
@Test public void testDowngrade() { NodeEndpoint endpoint = new NodeEndpoint("A", "localhost", 2333); NodeGroup group = new NodeGroup(endpoint); Assert.assertEquals(1, group.getCountOfMajor()); group.downgrade(endpoint.getId()); Assert.assertEquals(0, group.getCountOfMajor()); Assert.assertTrue(group.findMember(endpoint.getId()).isRemoving()); }