ResourceAdvisor extends DistributionAdvisor { public boolean isHeapCritical(final InternalDistributedMember member) { ResourceManagerProfile rmp = (ResourceManagerProfile) getProfile(member); return rmp != null ? rmp.getHeapState().isCritical() : false; } private  ResourceAdvisor(DistributionAdvisee advisee); static ResourceAdvisor createResourceAdvisor(DistributionAdvisee advisee); @Override String toString(); Set<InternalDistributedMember> adviseCriticalMembers(); boolean isHeapCritical(final InternalDistributedMember member); synchronized void updateRemoteProfile(); @Override void close();  }
@Test public void shouldBeMockable() throws Exception { ResourceAdvisor mockResourceAdvisor = mock(ResourceAdvisor.class); InternalDistributedMember mockInternalDistributedMember = mock(InternalDistributedMember.class); when(mockResourceAdvisor.isHeapCritical(eq((mockInternalDistributedMember)))).thenReturn(true); assertThat(mockResourceAdvisor.isHeapCritical(mockInternalDistributedMember)).isTrue(); }