InternalResourceManager implements ResourceManager { public void addStartupTask(CompletableFuture<Void> startupTask) { Objects.requireNonNull(startupTask); synchronized (startupTasks) { startupTasks.add(startupTask); } } private  InternalResourceManager(InternalCache cache); static InternalResourceManager getInternalResourceManager(Cache cache); static InternalResourceManager createResourceManager(final InternalCache cache); void close(); void fillInProfile(final Profile profile); void addResourceListener(final ResourceListener listener); void addResourceListener(final ResourceType resourceType,
      final ResourceListener listener); void removeResourceListener(final ResourceListener listener); void removeResourceListener(final ResourceType resourceType,
      final ResourceListener listener); Set<ResourceListener> getResourceListeners(final ResourceType resourceType); void deliverEventFromRemote(final ResourceEvent event); HeapMemoryMonitor getHeapMonitor(); OffHeapMemoryMonitor getOffHeapMonitor(); MemoryMonitor getMemoryMonitor(boolean offheap); @Override RebalanceFactory createRebalanceFactory(); @Override Set<RebalanceOperation> getRebalanceOperations(); @Override RestoreRedundancyOperation createRestoreRedundancyOperation(); @Override Set<CompletableFuture<RestoreRedundancyResults>> getRestoreRedundancyFutures(); ScheduledExecutorService getExecutor(); ResourceManagerStats getStats(); static void setResourceObserver(ResourceObserver observer); static ResourceObserver getResourceObserver(); CancelCriterion getCancelCriterion(); ResourceAdvisor getResourceAdvisor(); LoadProbe getLoadProbe(); LoadProbe setLoadProbe(LoadProbe probe); @Override void setCriticalOffHeapPercentage(float offHeapPercentage); @Override float getCriticalOffHeapPercentage(); @Override void setEvictionOffHeapPercentage(float offHeapPercentage); @Override float getEvictionOffHeapPercentage(); @Override void setCriticalHeapPercentage(float heapPercentage); @Override float getCriticalHeapPercentage(); @Override void setEvictionHeapPercentage(float heapPercentage); @Override float getEvictionHeapPercentage(); void addStartupTask(CompletableFuture<Void> startupTask); CompletableFuture<Void> allOfStartupTasks();  }
@Test public void addStartupTaskThrowsIfStartupTaskIsNull() { Throwable thrown = catchThrowable(() -> resourceManager.addStartupTask(null)); assertThat(thrown).isInstanceOf(NullPointerException.class); }