title: Best approach to tackle class naming collisions between namespaces
body: <p>I'm hitting a problem with a helper class I am working on to translate between 2 classes of the same name. Both classes are outside my scope of control, so I can't simply rename them.</p>
  
  <p>My basic options all involve declaring the namespace in full for at least one of the types:</p>
  
  <pre><code>import com.myco.second.long.package.namespace.MyObject;
  public class MyObjectConvertor {
  
      MyObject transform(com.myco.first.long.package.namespace.MyObject o) {}
  }
  </code></pre>
  
  <p>Or the reverse approach:</p>
  
  <pre><code>import com.myco.first.long.package.namespace.MyObject;
  public class MyObjectConvertor {
  
      com.myco.second.long.package.namespace.MyObject transform(MyObject o) {}
  }
  </code></pre>
  
  <p>Or declaring both namespaces, for a more explicit pattern:</p>
  
  <pre><code>public class MyObjectConvertor {
  
      com.myco.second.long.package.namespace.MyObject 
          transform(com.myco.first.long.package.namespace.MyObject o) {}
  }
  </code></pre>
  
  <p>Is there another solution that might tidy up these method signatures? I'm wondering if some kind of C++ "typedef" style solution might be possible?</p>