ValueResolution { public void add(InputValue inputValue) { if (inputValue.isResolved()) { resolved.add(inputValue); } else { unresolved.add(inputValue); } }  void add(InputValue inputValue); List<InputValue> resolved(); InputValue resolvedValue(int index); InputValue unresolvedValue(int index); int resolvedCount(); int unresolvedCount(); int totalCount();  }
@Test public void testAdd() { ValueResolution res = new ValueResolution(); assertThat(res.totalCount()).isEqualTo(0); assertThat(res.resolvedCount()).isEqualTo(0); assertThat(res.unresolvedCount()).isEqualTo(0); assertTrue(res.resolved().isEmpty()); InputValue inputResolved = new InputValue(TokenType.AND, "and"); assertTrue(inputResolved.isResolved()); InputValue inputUnresolved = new InputValue(new Token(TokenType.BETWEEN, "bet", 0, 3), null); assertFalse(inputUnresolved.isResolved()); res.add(inputResolved); assertThat(res.totalCount()).isEqualTo(1); assertThat(res.resolvedCount()).isEqualTo(1); assertThat(res.unresolvedCount()).isEqualTo(0); assertTrue(res.resolved().contains(inputResolved)); res.add(inputUnresolved); assertThat(res.totalCount()).isEqualTo(2); assertThat(res.resolvedCount()).isEqualTo(1); assertThat(res.unresolvedCount()).isEqualTo(1); assertTrue(res.resolved().contains(inputResolved)); assertFalse(res.resolved().contains(inputUnresolved)); assertThat(res.resolvedValue(0)).isSameAs(inputResolved); assertThat(res.unresolvedValue(0)).isSameAs(inputUnresolved); }