@Test public void testAddStatement() { LOG.info("Try to add two copies of the same statement in a payload." + " Expected only one statement is inserted and no null values allowed."); String logical = Statement.AND; String attribute = "param"; String operand = Statement.EQUALS; String value = "value"; Payload payload = new Payload(); int preSize = payload.size(); payload.addStatement(logical, attribute, operand, value); payload.addStatement(logical, attribute, operand, value); int postSize = payload.size(); assertEquals(preSize + 1, postSize); assertEquals(1, postSize); assertEquals(payload.getStatements(attribute).get(0).getAttribute(), attribute); assertEquals(payload.getStatements(attribute).get(0).getValue(), value); assertNotNull(payload.getStatements(attribute).get(0)); assertNotNull(payload.getStatements(attribute).get(0)); }
public void addStatement(String logical, String attribute, String operand, String value) { enqueueStatement(new Statement().create(logical, attribute, operand, value)); }
Payload implements Serializable { public void addStatement(String logical, String attribute, String operand, String value) { enqueueStatement(new Statement().create(logical, attribute, operand, value)); } }
Payload implements Serializable { public void addStatement(String logical, String attribute, String operand, String value) { enqueueStatement(new Statement().create(logical, attribute, operand, value)); }  }
Payload implements Serializable { public void addStatement(String logical, String attribute, String operand, String value) { enqueueStatement(new Statement().create(logical, attribute, operand, value)); }  void addStatement(String logical, String attribute, String operand, String value); void addStatement(String attribute, String value); void addStatement(String attribute, int value); void enqueueStatement(Statement s); int size(); @Override boolean equals(Object obj); @Override int hashCode(); List<Statement> getStatements(String attribute); List<Statement> getStatements(); String getStatementsAsJson(); String getStatementValue(String attribute); Iterator<Statement> iterator(); void merge(Payload anotherPayload); @Override String toString(); void clear(); }
Payload implements Serializable { public void addStatement(String logical, String attribute, String operand, String value) { enqueueStatement(new Statement().create(logical, attribute, operand, value)); }  void addStatement(String logical, String attribute, String operand, String value); void addStatement(String attribute, String value); void addStatement(String attribute, int value); void enqueueStatement(Statement s); int size(); @Override boolean equals(Object obj); @Override int hashCode(); List<Statement> getStatements(String attribute); List<Statement> getStatements(); String getStatementsAsJson(); String getStatementValue(String attribute); Iterator<Statement> iterator(); void merge(Payload anotherPayload); @Override String toString(); void clear();  }