@Test public void testBotSides() { Point2D.Double botLocation = newLocation(348, 741); RobotState state = RobotState.newBuilder() .setLocation(botLocation) .build(); List<Line2D.Double> botSides = state.botSides(); assertTrue( listContainsLine(botSides, new Line2D.Double(366, 723, 366, 759))); assertTrue( listContainsLine(botSides, new Line2D.Double(366, 759, 330, 759))); assertTrue( listContainsLine(botSides, new Line2D.Double(330, 759, 330, 723))); assertTrue( listContainsLine(botSides, new Line2D.Double(330, 723, 366, 723))); assertEquals(botSides, state.botSides()); }
public List<Line2D.Double> botSides() { if (_botSides == null) { _botSides = new ArrayList<Line2D.Double>(); _botSides.add(new Line2D.Double(location.x - 18, location.y - 18, location.x + 18, location.y - 18)); _botSides.add(new Line2D.Double(location.x + 18, location.y - 18, location.x + 18, location.y + 18)); _botSides.add(new Line2D.Double(location.x + 18, location.y + 18, location.x - 18, location.y + 18)); _botSides.add(new Line2D.Double(location.x - 18, location.y + 18, location.x - 18, location.y - 18)); } return _botSides; }
RobotState { public List<Line2D.Double> botSides() { if (_botSides == null) { _botSides = new ArrayList<Line2D.Double>(); _botSides.add(new Line2D.Double(location.x - 18, location.y - 18, location.x + 18, location.y - 18)); _botSides.add(new Line2D.Double(location.x + 18, location.y - 18, location.x + 18, location.y + 18)); _botSides.add(new Line2D.Double(location.x + 18, location.y + 18, location.x - 18, location.y + 18)); _botSides.add(new Line2D.Double(location.x - 18, location.y + 18, location.x - 18, location.y - 18)); } return _botSides; } }
RobotState { public List<Line2D.Double> botSides() { if (_botSides == null) { _botSides = new ArrayList<Line2D.Double>(); _botSides.add(new Line2D.Double(location.x - 18, location.y - 18, location.x + 18, location.y - 18)); _botSides.add(new Line2D.Double(location.x + 18, location.y - 18, location.x + 18, location.y + 18)); _botSides.add(new Line2D.Double(location.x + 18, location.y + 18, location.x - 18, location.y + 18)); _botSides.add(new Line2D.Double(location.x - 18, location.y + 18, location.x - 18, location.y - 18)); } return _botSides; } private  RobotState(Point2D.Double location, double heading, double velocity,
      long time, boolean interpolated); }
RobotState { public List<Line2D.Double> botSides() { if (_botSides == null) { _botSides = new ArrayList<Line2D.Double>(); _botSides.add(new Line2D.Double(location.x - 18, location.y - 18, location.x + 18, location.y - 18)); _botSides.add(new Line2D.Double(location.x + 18, location.y - 18, location.x + 18, location.y + 18)); _botSides.add(new Line2D.Double(location.x + 18, location.y + 18, location.x - 18, location.y + 18)); _botSides.add(new Line2D.Double(location.x - 18, location.y + 18, location.x - 18, location.y - 18)); } return _botSides; } private  RobotState(Point2D.Double location, double heading, double velocity,
      long time, boolean interpolated); List<Point2D.Double> botCorners(); Rectangle2D.Double botRectangle(); List<Line2D.Double> botSides(); static Builder newBuilder(); }
RobotState { public List<Line2D.Double> botSides() { if (_botSides == null) { _botSides = new ArrayList<Line2D.Double>(); _botSides.add(new Line2D.Double(location.x - 18, location.y - 18, location.x + 18, location.y - 18)); _botSides.add(new Line2D.Double(location.x + 18, location.y - 18, location.x + 18, location.y + 18)); _botSides.add(new Line2D.Double(location.x + 18, location.y + 18, location.x - 18, location.y + 18)); _botSides.add(new Line2D.Double(location.x - 18, location.y + 18, location.x - 18, location.y - 18)); } return _botSides; } private  RobotState(Point2D.Double location, double heading, double velocity,
      long time, boolean interpolated); List<Point2D.Double> botCorners(); Rectangle2D.Double botRectangle(); List<Line2D.Double> botSides(); static Builder newBuilder(); final Point2D.Double location; final double heading; final double velocity; final long time; final boolean interpolated; }