### Question:
AbstractLayoutService implements LayoutService { protected double getLayoutInformationThreshold(final Graph<?, ?> graph) { final List<Node> list = new ArrayList<>(); graph.nodes().iterator().forEachRemaining(list::add); return list.size() / 4.0D; }  @Override boolean hasLayoutInformation(final Graph<?, ?> graph); @Override abstract Layout createLayout(Graph<?, ?> graph);  }### Answer:
@Test public void getLayoutInformationThreshold() { when(n1.getUUID()).thenReturn(UUID.uuid()); when(n2.getUUID()).thenReturn(UUID.uuid()); final GraphNodeStoreImpl store = new GraphNodeStoreImpl(); store.add(n1); doCallRealMethod().when(layoutService).getLayoutInformationThreshold(graph); when(graph.nodes()).thenReturn(store); double threshold = layoutService.getLayoutInformationThreshold(graph); assertEquals(0.25, threshold, 0.01); store.add(n2); threshold = layoutService.getLayoutInformationThreshold(graph); assertEquals(0.50, threshold, 0.01); }