@Test public void passObjectAndReturnAsClass() { Class<?> result = new ObjectTypeRetriever().apply(new A()); assertTrue(result.equals(A.class)); }
@Override public Class<?> apply(@Nullable Object object) { if (object == null) { return NullType.class; } else if (object instanceof Class) { return (Class) object; } else { return object.getClass(); } }
ObjectTypeRetriever implements Function<Object, Class<?>> { @Override public Class<?> apply(@Nullable Object object) { if (object == null) { return NullType.class; } else if (object instanceof Class) { return (Class) object; } else { return object.getClass(); } } }
ObjectTypeRetriever implements Function<Object, Class<?>> { @Override public Class<?> apply(@Nullable Object object) { if (object == null) { return NullType.class; } else if (object instanceof Class) { return (Class) object; } else { return object.getClass(); } }  }
ObjectTypeRetriever implements Function<Object, Class<?>> { @Override public Class<?> apply(@Nullable Object object) { if (object == null) { return NullType.class; } else if (object instanceof Class) { return (Class) object; } else { return object.getClass(); } }  @Override Class<?> apply(@Nullable Object object); }
ObjectTypeRetriever implements Function<Object, Class<?>> { @Override public Class<?> apply(@Nullable Object object) { if (object == null) { return NullType.class; } else if (object instanceof Class) { return (Class) object; } else { return object.getClass(); } }  @Override Class<?> apply(@Nullable Object object);  }