ClusterElderManager { public boolean isElder() { return clusterDistributionManager.getId().equals(getElderCandidate()); } ClusterElderManager(ClusterDistributionManager clusterDistributionManager);  ClusterElderManager(ClusterDistributionManager clusterDistributionManager,
      Supplier<ElderState> elderStateSupplier); InternalDistributedMember getElderId(); boolean isElder(); ElderState getElderState(boolean waitToBecomeElder); boolean waitForElder(final InternalDistributedMember desiredElder);  }
@Test public void isElderIfOldestMember() { ClusterElderManager clusterElderManager = new ClusterElderManager(clusterDistributionManager); when(clusterDistributionManager.getViewMembers()).thenReturn(Arrays.asList(member0, member1)); when(clusterDistributionManager.getId()).thenReturn(member0); assertThat(clusterElderManager.isElder()).isTrue(); }
@Test public void isNotElderIfOldestMember() { ClusterElderManager clusterElderManager = new ClusterElderManager(clusterDistributionManager); when(clusterDistributionManager.getViewMembers()).thenReturn(Arrays.asList(member1, member0)); when(clusterDistributionManager.getId()).thenReturn(member0); assertThat(clusterElderManager.isElder()).isFalse(); }