Program: 6313
Project: 6313
Buggy source:
@Test public void testAll() throws Exception {
  Id.Namespace namespace=Id.Namespace.DEFAULT;
  Id.Stream stream=Id.Stream.from(namespace,"String_Node_Str");
  Id.Stream.View view1=Id.Stream.View.from(stream,"String_Node_Str");
  LOG.info("String_Node_Str",stream);
  streamClient.create(stream);
  try {
    LOG.info("String_Node_Str",stream);
    streamClient.sendEvent(stream,"String_Node_Str");
    streamClient.sendEvent(stream,"String_Node_Str");
    streamClient.sendEvent(stream,"String_Node_Str");
    LOG.info("String_Node_Str");
    Assert.assertEquals(ImmutableList.of(),streamViewClient.list(stream));
    try {
      streamViewClient.get(view1);
      Assert.fail();
    }
 catch (    NotFoundException e) {
      Assert.assertEquals(view1,e.getObject());
    }
    FormatSpecification format=new FormatSpecification("String_Node_Str",Schema.recordOf("String_Node_Str",Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.STRING)),Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.STRING)),Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.STRING))));
    ViewSpecification viewSpecification=new ViewSpecification(format,"String_Node_Str");
    LOG.info("String_Node_Str",view1,GSON.toJson(viewSpecification));
    Assert.assertEquals(true,streamViewClient.createOrUpdate(view1,viewSpecification));
    LOG.info("String_Node_Str",view1);
    Assert.assertEquals(new ViewDetail(view1.getId(),viewSpecification),streamViewClient.get(view1));
    Assert.assertEquals(ImmutableList.of(view1.getId()),streamViewClient.list(stream));
    FormatSpecification newFormat=new FormatSpecification("String_Node_Str",Schema.recordOf("String_Node_Str",Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.STRING)),Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.STRING)),Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.STRING))));
    ViewSpecification newViewSpecification=new ViewSpecification(newFormat,"String_Node_Str");
    LOG.info("String_Node_Str",view1,GSON.toJson(newViewSpecification));
    Assert.assertEquals(false,streamViewClient.createOrUpdate(view1,newViewSpecification));
    LOG.info("String_Node_Str",view1);
    Assert.assertEquals(new ViewDetail(view1.getId(),newViewSpecification),streamViewClient.get(view1));
    Assert.assertEquals(ImmutableList.of(view1.getId()),streamViewClient.list(stream));
    ExploreExecutionResult executionResult=queryClient.execute(view1.getNamespace(),"String_Node_Str").get();
    Assert.assertNotNull(executionResult.getResultSchema());
    Assert.assertEquals(3,executionResult.getResultSchema().size());
    Assert.assertEquals("String_Node_Str",executionResult.getResultSchema().get(0).getName());
    Assert.assertEquals("String_Node_Str",executionResult.getResultSchema().get(1).getName());
    Assert.assertEquals("String_Node_Str",executionResult.getResultSchema().get(2).getName());
    List<QueryResult> results=Lists.newArrayList(executionResult);
    Assert.assertNotNull(results);
    Assert.assertEquals(3,results.size());
    Assert.assertEquals("String_Node_Str",results.get(0).getColumns().get(0));
    Assert.assertEquals("String_Node_Str",results.get(0).getColumns().get(1));
    Assert.assertEquals("String_Node_Str",results.get(0).getColumns().get(2));
    Assert.assertEquals("String_Node_Str",results.get(1).getColumns().get(0));
    Assert.assertEquals("String_Node_Str",results.get(1).getColumns().get(1));
    Assert.assertEquals("String_Node_Str",results.get(1).getColumns().get(2));
    Assert.assertEquals("String_Node_Str",results.get(2).getColumns().get(0));
    Assert.assertEquals("String_Node_Str",results.get(2).getColumns().get(1));
    Assert.assertEquals("String_Node_Str",results.get(2).getColumns().get(2));
    LOG.info("String_Node_Str",view1);
    streamViewClient.delete(view1);
    LOG.info("String_Node_Str",view1);
    try {
      streamViewClient.get(view1);
      Assert.fail();
    }
 catch (    NotFoundException e) {
      Assert.assertEquals(view1,e.getObject());
    }
    Assert.assertEquals(ImmutableList.of(),streamViewClient.list(stream));
  }
  finally {
    streamClient.delete(stream);
  }
  LOG.info("String_Node_Str",stream);
  streamClient.create(stream);
  try {
    FormatSpecification format=new FormatSpecification("String_Node_Str",Schema.recordOf("String_Node_Str",Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.STRING)),Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.STRING)),Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.STRING))));
    ViewSpecification viewSpecification=new ViewSpecification(format,"String_Node_Str");
    LOG.info("String_Node_Str",view1,GSON.toJson(viewSpecification));
    Assert.assertEquals(true,streamViewClient.createOrUpdate(view1,viewSpecification));
    streamClient.delete(stream);
  }
  finally {
    streamViewClient.delete(view1);
    streamClient.delete(stream);
  }
}

Fixed version (ground truth):
@Test public void testAll() throws Exception {
  Id.Namespace namespace=Id.Namespace.DEFAULT;
  Id.Stream stream=Id.Stream.from(namespace,"String_Node_Str");
  Id.Stream.View view1=Id.Stream.View.from(stream,"String_Node_Str");
  LOG.info("String_Node_Str",stream);
  streamClient.create(stream);
  try {
    LOG.info("String_Node_Str",stream);
    streamClient.sendEvent(stream,"String_Node_Str");
    streamClient.sendEvent(stream,"String_Node_Str");
    streamClient.sendEvent(stream,"String_Node_Str");
    LOG.info("String_Node_Str");
    Assert.assertEquals(ImmutableList.of(),streamViewClient.list(stream));
    try {
      streamViewClient.get(view1);
      Assert.fail();
    }
 catch (    NotFoundException e) {
      Assert.assertEquals(view1,e.getObject());
    }
    FormatSpecification format=new FormatSpecification("String_Node_Str",Schema.recordOf("String_Node_Str",Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.STRING)),Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.STRING)),Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.STRING))));
    ViewSpecification viewSpecification=new ViewSpecification(format,"String_Node_Str");
    LOG.info("String_Node_Str",view1,GSON.toJson(viewSpecification));
    Assert.assertEquals(true,streamViewClient.createOrUpdate(view1,viewSpecification));
    LOG.info("String_Node_Str",view1);
    Assert.assertEquals(new ViewDetail(view1.getId(),viewSpecification),streamViewClient.get(view1));
    Assert.assertEquals(ImmutableList.of(view1.getId()),streamViewClient.list(stream));
    FormatSpecification newFormat=new FormatSpecification("String_Node_Str",Schema.recordOf("String_Node_Str",Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.STRING)),Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.STRING)),Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.STRING))));
    ViewSpecification newViewSpecification=new ViewSpecification(newFormat,"String_Node_Str");
    LOG.info("String_Node_Str",view1,GSON.toJson(newViewSpecification));
    Assert.assertEquals(false,streamViewClient.createOrUpdate(view1,newViewSpecification));
    LOG.info("String_Node_Str",view1);
    Assert.assertEquals(new ViewDetail(view1.getId(),newViewSpecification),streamViewClient.get(view1));
    Assert.assertEquals(ImmutableList.of(view1.getId()),streamViewClient.list(stream));
    ExploreExecutionResult executionResult=queryClient.execute(view1.getNamespace(),"String_Node_Str").get();
    Assert.assertNotNull(executionResult.getResultSchema());
    Assert.assertEquals(3,executionResult.getResultSchema().size());
    Assert.assertEquals("String_Node_Str",executionResult.getResultSchema().get(0).getName());
    Assert.assertEquals("String_Node_Str",executionResult.getResultSchema().get(1).getName());
    Assert.assertEquals("String_Node_Str",executionResult.getResultSchema().get(2).getName());
    List<QueryResult> results=Lists.newArrayList(executionResult);
    Assert.assertNotNull(results);
    Assert.assertEquals(3,results.size());
    Assert.assertEquals("String_Node_Str",results.get(0).getColumns().get(0));
    Assert.assertEquals("String_Node_Str",results.get(0).getColumns().get(1));
    Assert.assertEquals("String_Node_Str",results.get(0).getColumns().get(2));
    Assert.assertEquals("String_Node_Str",results.get(1).getColumns().get(0));
    Assert.assertEquals("String_Node_Str",results.get(1).getColumns().get(1));
    Assert.assertEquals("String_Node_Str",results.get(1).getColumns().get(2));
    Assert.assertEquals("String_Node_Str",results.get(2).getColumns().get(0));
    Assert.assertEquals("String_Node_Str",results.get(2).getColumns().get(1));
    Assert.assertEquals("String_Node_Str",results.get(2).getColumns().get(2));
    LOG.info("String_Node_Str",view1);
    streamViewClient.delete(view1);
    LOG.info("String_Node_Str",view1);
    try {
      streamViewClient.get(view1);
      Assert.fail();
    }
 catch (    NotFoundException e) {
      Assert.assertEquals(view1,e.getObject());
    }
    Assert.assertEquals(ImmutableList.of(),streamViewClient.list(stream));
  }
  finally {
    streamClient.delete(stream);
  }
  LOG.info("String_Node_Str",stream);
  streamClient.create(stream);
  try {
    FormatSpecification format=new FormatSpecification("String_Node_Str",Schema.recordOf("String_Node_Str",Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.STRING)),Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.STRING)),Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.STRING))));
    ViewSpecification viewSpecification=new ViewSpecification(format,"String_Node_Str");
    LOG.info("String_Node_Str",view1,GSON.toJson(viewSpecification));
    Assert.assertEquals(true,streamViewClient.createOrUpdate(view1,viewSpecification));
  }
  finally {
    streamClient.delete(stream);
  }
}