Bytecode implements Cloneable, Serializable { public void addSource(final String sourceName, final Object... arguments) { if (sourceName.equals(TraversalSource.Symbols.withoutStrategies)) { if (arguments == null) this.sourceInstructions.add(new Instruction(sourceName, null)); else { final Class<TraversalStrategy>[] classes = new Class[arguments.length]; for (int i = 0; i < arguments.length; i++) { classes[i] = arguments[i] instanceof TraversalStrategyProxy ? ((TraversalStrategyProxy) arguments[i]).getStrategyClass() : (Class) arguments[i]; } this.sourceInstructions.add(new Instruction(sourceName, classes)); } } else this.sourceInstructions.add(new Instruction(sourceName, flattenArguments(arguments))); Bindings.clear(); }  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 shouldAvoidArgumentsNpe() { final Bytecode first = new Bytecode(); try { first.addSource("3", null); first.addSource(TraversalSource.Symbols.withoutStrategies, null); } catch (Exception e) { e.getCause().printStackTrace(System.err); } }