@Test public void testIsInetAddressUp() throws UnknownHostException { InetAddress expectedAddress = InetAddress.getLocalHost(); List<String> expectedLiveNodes = Collections.singletonList(expectedAddress.getHostName()); List<String> expectedUnreachableNodes = Collections.emptyList(); when(myJmxProxy.getLiveNodes()).thenReturn(expectedLiveNodes); when(myJmxProxy.getUnreachableNodes()).thenReturn(expectedUnreachableNodes); assertThat(myHostStates.isUp(expectedAddress)).isTrue(); }
@Override public boolean isUp(InetAddress address) { refreshNodeStatus(); Boolean status = myHostStates.get(address); return status != null && status; }
HostStatesImpl implements HostStates, Closeable { @Override public boolean isUp(InetAddress address) { refreshNodeStatus(); Boolean status = myHostStates.get(address); return status != null && status; } }
HostStatesImpl implements HostStates, Closeable { @Override public boolean isUp(InetAddress address) { refreshNodeStatus(); Boolean status = myHostStates.get(address); return status != null && status; } private  HostStatesImpl(Builder builder); }
HostStatesImpl implements HostStates, Closeable { @Override public boolean isUp(InetAddress address) { refreshNodeStatus(); Boolean status = myHostStates.get(address); return status != null && status; } private  HostStatesImpl(Builder builder); @Override boolean isUp(InetAddress address); @Override boolean isUp(Host host); @Override void close(); static Builder builder(); }
HostStatesImpl implements HostStates, Closeable { @Override public boolean isUp(InetAddress address) { refreshNodeStatus(); Boolean status = myHostStates.get(address); return status != null && status; } private  HostStatesImpl(Builder builder); @Override boolean isUp(InetAddress address); @Override boolean isUp(Host host); @Override void close(); static Builder builder();  }