Question: I'm trying to create jsp page which will create a svg graphic file. Based on various examples of jsp pages and svgs i come with this:

```
<?xml version="1.0" encoding="UTF-8"?> 

<%@ page language="java" contentType="image/svg+xml; charset=UTF-8;"    pageEncoding="UTF-8"%>

<%
response.addHeader(
        "Content-Disposition","attachment; filename=blob3" );
%>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="140" width="140" viewBox="0 0 14 14">
  <circle cx="7" cy="7" r="6" fill="blue" />
</svg>

```

but it is not working. it allows me to download blob3.svg file, but it is empty file.

Can anyone could give me hint, what i'm doing wrong?

Answer: 
This is a known Scala-Java interoperability problem, though it's unfortunately not in the FAQ. Here's the [Scala ticket describing the problem](https://issues.scala-lang.org/browse/SI-2991). Essentially, both methods are applicable when you give a single argument, and the Scala compiler currently doesn't have any heuristic to decide which one is "more specific". [Alexey Romanov's approach to always use the varargs version](https://stackoverflow.com/a/13358823/384641) is a good workaround:

```
thenReturn("something", Nil: _*)

```

There is also a [question running into a similar problem with JCommander](https://stackoverflow.com/questions/3313929/how-do-i-disambiguate-in-scala-between-methods-with-vararg-and-without). One of the answers there gives a clever workaround using structural types. This approach will use reflection behind the scenes, so you may or may not want to go that direction. For your use case, it would look something like:

```
type useSingleArgVersion = { def thenReturn(value: AnyRef): OngoingStubbing }
(...).asInstanceOf[useSingleArgVersion].thenReturn("something")

```

Finally, there is a [similar question running into a similar problem with mokito](https://stackoverflow.com/questions/2159248/spurious-ambiguous-reference-error-in-scala-2-7-7-compiler-interpreter). It doesn't really provide any workarounds, but it does describe the problem in a bit more detail, if you're interested in the reason this happens.
I tried Steve's solution and got a huge compiler error including:

```
scala.tools.nsc.symtab.Types$TypeError: type mismatch;
 found   : scala.reflect.Manifest[Nothing]
 required: scala.reflect.ClassManifest[B]
Note: Nothing <: B, but trait ClassManifest is invariant in type T.
You may wish to investigate a wildcard type such as `_ <: B`. (SLS 3.2.10)

```

I was able to make it work with something like:

```
thenReturn("something", Seq.empty[Object]: _*)

```