### Question:
SimpleQueryInp extends AbstractIRODSPackingInstruction { @Override public Tag getTagValue() throws JargonException { String arg1 = ""; String arg2 = ""; String arg3 = ""; String arg4 = ""; int sz = simpleQuery.getArguments().size(); if (sz > 0 && simpleQuery.getArguments().get(0) != null) { arg1 = simpleQuery.getArguments().get(0); } if (sz > 1 && simpleQuery.getArguments().get(1) != null) { arg2 = simpleQuery.getArguments().get(1); } if (sz > 2 && simpleQuery.getArguments().get(2) != null) { arg3 = simpleQuery.getArguments().get(2); } if (sz > 3 && simpleQuery.getArguments().get(3) != null) { arg4 = simpleQuery.getArguments().get(3); } Tag message = new Tag(PI_TAG, new Tag[] { new Tag(SQL, simpleQuery.getQueryString()), new Tag(ARG1, arg1), new Tag(ARG2, arg2), new Tag(ARG3, arg3), new Tag(ARG4, arg4), new Tag(CONTROL, simpleQuery.getContinuationValue()), new Tag(FORM, 2), new Tag(MAX_BUF_SIZE, maxBuffSize), }); return message; } private  SimpleQueryInp(final int apiNbr, final AbstractAliasedQuery simpleQuery); static SimpleQueryInp instance(final AbstractAliasedQuery simpleQuery); AbstractAliasedQuery getSimpleQuery(); int getMaxBuffSize(); @Override Tag getTagValue(); static final String PI_TAG; static final int SIMPLE_QUERY_API_NBR; static final String SQL; static final String ARG1; static final String ARG2; static final String ARG3; static final String ARG4; static final String CONTROL; static final String FORM; static final String MAX_BUF_SIZE; }### Answer:
@Test public void testGetTagValue() throws Exception { AbstractAliasedQuery sq = SimpleQuery.instanceWithOneArgument("query", "myargs", 0); SimpleQueryInp simpleQueryInp = SimpleQueryInp.instance(sq); String tagVal = simpleQueryInp.getParsedTags(); StringBuilder sb = new StringBuilder(); sb.append("<simpleQueryInp_PI><sql>query</sql>\n"); sb.append("<arg1>myargs</arg1>\n"); sb.append("<arg2></arg2>\n"); sb.append("<arg3></arg3>\n"); sb.append("<arg4></arg4>\n"); sb.append("<control>0</control>\n"); sb.append("<form>2</form>\n"); sb.append("<maxBufSize>1024</maxBufSize>\n"); sb.append("</simpleQueryInp_PI>\n"); Assert.assertEquals("did not get expected tag value", sb.toString(), tagVal); }