BisectRepository { public Bisect get(long buildId) { return tryParse(storage.getValue(String.valueOf(buildId))); } BisectRepository(CustomDataStorage storage); boolean exists(long buildId); void create(long buildId); Bisect[] getAllNotFinished(); Bisect get(long buildId); void save(Bisect bisect);  }
@Test public void Get_Exists_Returns() throws Exception { stub(storage.getValue("10")).toReturn("{\"buildId\":10,\"builds\":[],\"isFinished\":true,\"changes\":[1, 2, 3],\"solved\":false,\"answer\":0}"); Bisect actual = sut.get(10); assertEquals(actual.getChanges().size(), 3); assertTrue(actual.isFinished()); }