I managed to solve it, but appreciate any guidance anyone has.
What I was missing was declaring the variable on the outside.
If anyone needs it:
List<String> output = new ArrayList();
final List<Vertex> temp = new ArrayList();
IndexableGraph g = TinkerGraphFactory.createTinkerGraph();
output = new GremlinPipeline(g.getVertex(1))
.sideEffect(
new PipeFunction<Vertex, Vertex>() {
public Vertex compute(Vertex it) {
temp.add(it);
return it;
}
}
)
.out("created")
.in("created")
.filter(
new PipeFunction<Vertex, Boolean>() {
public Boolean compute(Vertex it) {
if (temp.contains(it))
return false;
else
return true;
}
}
)
.toList();
System.out.println(output);