Buggy code:
@ POST @ Path ( "//getuserinformation" ) @ Consumes ( MediaType . APPLICATION_JSON ) @ Produces ( MediaType . APPLICATION_JSON ) public Response getUserInformation ( final String json ) throws IOException { } @ POST @ Path ( "//updateuserpassword" ) @ Consumes ( MediaType . APPLICATION_JSON ) @ Produces ( MediaType . APPLICATION_JSON ) public Response updateUserPassword ( final String json ) throws IOException { } @ POST @ Path ( "//createnewuser" ) @ Consumes ( MediaType . APPLICATION_JSON ) @ Produces ( MediaType . APPLICATION_JSON ) public Response createNewUser ( final String json ) throws IOException { } @ POST @ Path ( "//getfilteredvariants" ) @ Consumes ( MediaType . APPLICATION_JSON ) @ Produces ( MediaType . APPLICATION_JSON ) public Response getFilteredVariants ( final String json ) throws IOException { } @ VariantDatabasePlugin . Workflow ( name = "Autosomal<seq2seq4repair_space>Dominant<seq2seq4repair_space>Workflow<seq2seq4repair_space>v1" , description = "A<seq2seq4repair_space>workflow<seq2seq4repair_space>to<seq2seq4repair_space>extract<seq2seq4repair_space>rare<seq2seq4repair_space>autosomal<seq2seq4repair_space>heterozygous<seq2seq4repair_space>calls" ) public void runAutosomalDominantWorkflowv1 ( JsonGenerator jg , HashSet < Long > excludeRunInfoNodes , HashSet < Long > includePanelNodes , Node runInfoNode ) throws IOException { } @ VariantDatabasePlugin . Workflow ( name = "Rare<seq2seq4repair_space>Homozygous<seq2seq4repair_space>Workflow<seq2seq4repair_space>v1" , description = "A<seq2seq4repair_space>workflow<seq2seq4repair_space>to<seq2seq4repair_space>extract<seq2seq4repair_space>rare<seq2seq4repair_space>homozygous<seq2seq4repair_space>calls" ) public void runRareHomozygousWorkflowv1 ( JsonGenerator jg , HashSet < Long > excludeRunInfoNodes , HashSet < Long > includePanelNodes , Node runInfoNode ) throws IOException { } @ VariantDatabasePlugin . Workflow ( name = "Autosomal<seq2seq4repair_space>Recessive<seq2seq4repair_space>Workflow<seq2seq4repair_space>v1" , description = "A<seq2seq4repair_space>workflow<seq2seq4repair_space>to<seq2seq4repair_space>extract<seq2seq4repair_space>rare<seq2seq4repair_space>autosomal<seq2seq4repair_space>compound<seq2seq4repair_space>calls" ) public void runAutosomalRecessiveWorkflowv1 ( JsonGenerator jg , HashSet < Long > excludeRunInfoNodes , HashSet < Long > includePanelNodes , Node runInfoNode ) throws IOException { } private int getGlobalVariantOccurrence ( Node variantNode ) { } private int getAssayVariantOccurrence ( Node variantNode , String assay ) { } private int getPanelOccurrence ( String assay ) { } private boolean is1KGRareVariant ( Node variantNode , double maxAlleleFrequency ) { } private boolean isExACRareVariant ( Node variantNode , double maxAlleleFrequency ) { } private int getVariantPathogenicityClassification ( Node variantNode ) { } private String getVariantInheritance ( String inheritanceRelationshipTypeName ) { } private double getVariantInternalFrequency ( int panelOccurrence , int variantOccurrence ) { } private boolean variantBelongsToVirtualPanel ( Node variantNode , HashSet < Long > panelNodeIds ) { } private boolean variantPresentInExclusionSamples ( Node variantNode , HashSet < Long > excludedRunInfoNodeIds ) { } private void writeUserInformation ( Node userNode , JsonGenerator jg ) throws IOException { } private void writeSampleInformation ( Node sampleNode , JsonGenerator jg ) throws IOException { } private void writeRunInformation ( Node runInfoNode , JsonGenerator jg ) throws IOException { } private void writeVirtualPanelInformation ( Node virtualPanelNode , JsonGenerator jg ) throws IOException { } private void writeSymbolInformation ( Node symbolNode , JsonGenerator jg ) throws IOException { } private void writeFeatureInformation ( Node featureNode , JsonGenerator jg ) throws IOException { } private void writeVariantInformation ( Node variantNode , JsonGenerator jg ) throws IOException { } private void writeFunctionalAnnotation ( Node annotationNode , Relationship consequenceRel , Relationship biotypeRel , JsonGenerator jg ) throws IOException { } private boolean isClassificationPendingApproval ( Node variantNode ) { } private void writeFeatureHistory ( Node featureNode , JsonGenerator jg ) throws IOException { } private void writeVariantHistory ( Node variantNode , JsonGenerator jg ) throws IOException { } @ POST @ Path ( "//addvariantpathogenicity" ) @ Consumes ( MediaType . APPLICATION_JSON ) @ Produces ( MediaType . APPLICATION_JSON ) public Response addVariantPathogenicity ( final String json ) throws IOException { } @ POST @ Path ( "//removevariantpathogenicity" ) @ Consumes ( MediaType . APPLICATION_JSON ) @ Produces ( MediaType . APPLICATION_JSON ) public Response removeVariantPathogenicity ( final String json ) throws IOException { } @ POST @ Path ( "//authorisevariantpathogenicity" ) @ Consumes ( MediaType . APPLICATION_JSON ) @ Produces ( MediaType . APPLICATION_JSON ) public Response authoriseVariantPathogenicity ( final String json ) throws IOException { } @ GET @ Path ( "//getnewpathogenicitiesforauthorisation" ) @ Produces ( MediaType . APPLICATION_JSON ) <START_BUG> public Response getNewPathogenicitiesForAuthorisation ( final String json ) { <END_BUG> StreamingOutput stream = new StreamingOutput ( ) { @ Override public void write ( OutputStream os ) throws IOException , WebApplicationException { JsonGenerator jg = objectMapper . getJsonFactory ( ) . createJsonGenerator ( os , UTF8 ) ; jg . writeStartArray ( ) ; try ( Transaction tx = graphDb . beginTx ( ) ) { try ( ResourceIterator < Node > pathogenicityNodeIterator = graphDb . findNodes ( Neo4j . getPathogenicityLabel ( ) ) ) { while ( pathogenicityNodeIterator . hasNext ( ) ) { Node pathogenicityNode = pathogenicityNodeIterator . next ( ) ; Relationship addedByRelationship = pathogenicityNode . getSingleRelationship ( Neo4j . getAddedByRelationship ( ) , OUTGOING ) ; Relationship removedByRelationship = pathogenicityNode . getSingleRelationship ( Neo4j . getRemovedByRelationship ( ) , OUTGOING ) ; Relationship addAuthorisedByRelationship = pathogenicityNode . getSingleRelationship ( Neo4j . getAddAuthorisedByRelationship ( ) , OUTGOING ) ; Relationship removeAuthorisedByRelationship = pathogenicityNode . getSingleRelationship ( Neo4j . getRemoveAuthorisedByRelationship ( ) , OUTGOING ) ; Relationship hasPathogenicityRelationship = pathogenicityNode . getSingleRelationship ( Neo4j . getHasPathogenicityRelationship ( ) , INCOMING ) ; if ( ( ( ( addedByRelationship != null ) && ( removedByRelationship == null ) ) && ( addAuthorisedByRelationship == null ) ) && ( removeAuthorisedByRelationship == null ) ) { Node userNode = addedByRelationship . getEndNode ( ) ; Node variantNode = hasPathogenicityRelationship . getStartNode ( ) ; if ( ( userNode . hasLabel ( Neo4j . getUserLabel ( ) ) ) && ( variantNode . hasLabel ( Neo4j . getVariantLabel ( ) ) ) ) { jg . writeStartObject ( ) ; if ( variantNode . hasProperty ( "VariantId" ) ) jg . writeStringField ( "VariantId" , variantNode . getProperty ( "VariantId" ) . toString ( ) ) ; jg . writeNumberField ( "PathogenicityNodeId" , pathogenicityNode . getId ( ) ) ; if ( addedByRelationship . hasProperty ( "Classification" ) ) jg . writeNumberField ( "Classification" , ( ( int ) ( addedByRelationship . getProperty ( "Classification" ) ) ) ) ; jg . writeBooleanField ( "AddAction" , true ) ;

Fix:
public Response getNewPathogenicitiesForAuthorisation ( ) {