Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Matchers.any(Object) or Marchers.any(Type) #120

Closed
rafaelmborges opened this issue Nov 21, 2014 · 4 comments
Closed

Add Matchers.any(Object) or Marchers.any(Type) #120

rafaelmborges opened this issue Nov 21, 2014 · 4 comments

Comments

@rafaelmborges
Copy link

Matchers.any(Object) can receive any object, and via reflection, any() can figure out the right type (including generics). Ex.: any(new ImmutableSet<Foo>())

Or maybe have a Type class, something like guice's Key. Ex: any(new Key<ImmutableSet<Foo>>())

@mockitoguy
Copy link
Member

Hey, thanks for reporting?

There's already a Matchers.any(Class) - did you see it? If so, can describe what problem are you trying to solve. Thanks!

@rafaelmborges
Copy link
Author

Just fixing the original report:
Or maybe have a Type class, something like guice's Key. Ex: any(new Key < ImmutableSet < Long > >()).

@szczepiq:
Not having to put @SuppressWarning("unchecked")
You cannot type any(ImmutableSet < Long >.class).

@mockitoguy
Copy link
Member

Oh, I get it now, thanks

@bric3
Copy link
Contributor

bric3 commented Jun 5, 2015

Changes like that will be reported in #194. Closing, thanks for reporting

@bric3 bric3 closed this as completed Jun 5, 2015
neworld pushed a commit to neworld/mockito that referenced this issue Aug 31, 2019
Use `null as T` to create instances
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants