### Question:
TopologyLayouts { public static TopologyBoundaries computeBoundaries (Topology topology) { TopologyBoundaries boundaries = new TopologyBoundaries(); if(topology.getNodes().isEmpty()) return boundaries; boundaries.xMin = Double.MAX_VALUE; boundaries.yMin = Double.MAX_VALUE; boundaries.zMin = Double.MAX_VALUE; boundaries.xMax = -Double.MAX_VALUE; boundaries.yMax = -Double.MAX_VALUE; boundaries.zMax = -Double.MAX_VALUE; for (Node node : topology.getNodes()){ if (node.getX() > boundaries.xMax) boundaries.xMax = node.getX(); if (node.getY() > boundaries.yMax) boundaries.yMax = node.getY(); if (node.getZ() > boundaries.zMax) boundaries.zMax = node.getZ(); if (node.getX() < boundaries.xMin) boundaries.xMin = node.getX(); if (node.getY() < boundaries.yMin) boundaries.yMin = node.getY(); if (node.getZ() < boundaries.zMin) boundaries.zMin = node.getZ(); } return boundaries; }  static void autoscale(Topology topology); static void autoscale(Topology topology, AutoScaleParams autoScaleParams); static void center(Topology topology); static TopologyBoundaries computeBoundaries(Topology topology); static void circle(Topology topology, double marginRatio); static void circle(Topology topology); static void ellipse(Topology topology, double xMarginRatio, double yMarginRatio); static void ellipse(Topology topology); static void line(Topology topology, double marginRatio); static void line(Topology topology); static final double DEFAULT_MARGIN; }### Answer:
@Test void computeBoundaries_emptyTopology_ok() { TopologyLayouts.TopologyBoundaries boundaries = TopologyLayouts.computeBoundaries(new Topology()); TopologyLayouts.TopologyBoundaries expectedBoundaries = new TopologyLayouts.TopologyBoundaries(); checkSameBoundaries(expectedBoundaries, boundaries); }
@Test void computeBoundaries_basicEnvelope_ok() { TopologyLayouts.TopologyBoundaries expectedBoundaries = new TopologyLayouts.TopologyBoundaries(); expectedBoundaries.xMin = -25; expectedBoundaries.yMin = -20; expectedBoundaries.zMin = -10; expectedBoundaries.xMax = -1; expectedBoundaries.yMax = 200; expectedBoundaries.zMax = 100; Topology topology = new Topology(); addNodeAtLocation(topology, new Point(expectedBoundaries.xMin , 12, 15)); addNodeAtLocation(topology, new Point(-6, expectedBoundaries.yMin, expectedBoundaries.zMin)); addNodeAtLocation(topology, new Point(expectedBoundaries.xMax , 25, 42.2)); addNodeAtLocation(topology, new Point(-7, expectedBoundaries.yMax, 3.14)); addNodeAtLocation(topology, new Point(-3, 0, expectedBoundaries.zMax)); addNodeAtLocation(topology, new Point(-2, 0, 0)); TopologyLayouts.TopologyBoundaries boundaries = TopologyLayouts.computeBoundaries(topology); checkSameBoundaries(expectedBoundaries, boundaries); }