Bytecode implements Cloneable, Serializable { public Map<String, Object> getBindings() { final Map<String, Object> bindingsMap = new HashMap<>(); for (final Instruction instruction : this.sourceInstructions) { for (final Object argument : instruction.getArguments()) { addArgumentBinding(bindingsMap, argument); } } for (final Instruction instruction : this.stepInstructions) { for (final Object argument : instruction.getArguments()) { addArgumentBinding(bindingsMap, argument); } } return bindingsMap; }  void addSource(final String sourceName, final Object... arguments); void addStep(final String stepName, final Object... arguments); List<Instruction> getSourceInstructions(); List<Instruction> getStepInstructions(); Iterable<Instruction> getInstructions(); Map<String, Object> getBindings(); boolean isEmpty(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); @SuppressWarnings("CloneDoesntDeclareCloneNotSupportedException") @Override Bytecode clone();  }
@Test public void shouldIncludeBindingsInEquality() { final Bindings b = Bindings.instance(); final GraphTraversalSource g = EmptyGraph.instance().traversal(); final Bytecode bytecode1 = g.V().out(b.of("a", "created")).asAdmin().getBytecode(); final Bytecode bytecode2 = g.V().out(b.of("a", "knows")).asAdmin().getBytecode(); final Bytecode bytecode3 = g.V().out(b.of("b", "knows")).asAdmin().getBytecode(); final Bytecode bytecode4 = g.V().out(b.of("b", "knows")).asAdmin().getBytecode(); assertNotEquals(bytecode1, bytecode2); assertNotEquals(bytecode1, bytecode3); assertNotEquals(bytecode2, bytecode3); assertNotEquals(bytecode2, bytecode4); assertNotEquals(bytecode1, bytecode4); assertEquals(bytecode3, bytecode4); assertEquals(1, bytecode1.getBindings().size()); assertEquals("created", bytecode1.getBindings().get("a")); }