### Question:
SimpleQuery extends AbstractAliasedQuery { public static SimpleQuery instanceWithTwoArguments(final String queryString, final String arg1, final String arg2, final int continuationValue) { if (arg1 == null || arg1.isEmpty()) { throw new IllegalArgumentException("arg1 is null or empty"); } if (arg2 == null || arg2.isEmpty()) { throw new IllegalArgumentException("arg2 is null or empty"); } List<String> args = new ArrayList<String>(); args.add(arg1); args.add(arg2); return new SimpleQuery(queryString, args, continuationValue); } private  SimpleQuery(final String queryString, final List<String> arguments, final int continuationValue); static SimpleQuery instance(final String queryString, final List<String> arguments,
			final int continuationValue); static SimpleQuery instanceWithNoArguments(final String queryString, final int continuationValue); static SimpleQuery instanceWithOneArgument(final String queryString, final String arg,
			final int continuationValue); static SimpleQuery instanceWithTwoArguments(final String queryString, final String arg1, final String arg2,
			final int continuationValue);  }### Answer:
@Test public void testInstanceTwoArgsValid() throws Exception { String query = "query"; String arg1 = "arg1"; String arg2 = "arg2"; AbstractAliasedQuery sq = SimpleQuery.instanceWithTwoArguments(query, arg1, arg2, 0); Assert.assertEquals("invalid query value", query, sq.getQueryString()); Assert.assertEquals("invalid args", 2, sq.getArguments().size()); Assert.assertEquals("did not set args correctly", arg1, sq.getArguments().get(0)); Assert.assertEquals("did not set args correctly", arg2, sq.getArguments().get(1)); }
@Test(expected = IllegalArgumentException.class) public void testInstanceTwoArgsSecondArgBlank() throws Exception { String query = "query"; String arg1 = "arg1"; String arg2 = ""; SimpleQuery.instanceWithTwoArguments(query, arg1, arg2, 0); }