WeighBridgeController { @GetMapping("/brokers/current") public Broker getCurrentBroker() { return brokerReference.get(); }  @GetMapping("/brokers/current") Broker getCurrentBroker(); @GetMapping("/brokers") List<Broker> getAllBrokers();  }
@Test public void getCurrentBroker() { final Broker broker = new Broker(1, "rack", new ArrayList<>()); final HashMap<Integer, Broker> map = new HashMap<>(); underTest = new WeighBridgeController(new AtomicReference<>(broker), map); assertEquals(broker, underTest.getCurrentBroker()); }