@Test(expectedExceptions = RuntimeException.class, expectedExceptionsMessageRegExp = "com\\.proofpoint\\.reporting\\.TestReportCollectionFactory\\$NotConstructable\\.add\\(java\\.lang\\.String, boolean\\) return type ConstructorNeedsArgument has no public no-arg constructor") public void testReturnTypeNotConstructable() { reportCollectionFactory.createReportCollection(NotConstructable.class); }
@SuppressWarnings("unchecked") public <T> T createReportCollection(Class<T> aClass) { requireNonNull(aClass, "class is null"); return (T) newProxyInstance(aClass.getClassLoader(), new Class[]{aClass}, new StatInvocationHandler(aClass, false, Optional.of(aClass.getSimpleName()), ImmutableMap.of())); }
ReportCollectionFactory { @SuppressWarnings("unchecked") public <T> T createReportCollection(Class<T> aClass) { requireNonNull(aClass, "class is null"); return (T) newProxyInstance(aClass.getClassLoader(), new Class[]{aClass}, new StatInvocationHandler(aClass, false, Optional.of(aClass.getSimpleName()), ImmutableMap.of())); } }
ReportCollectionFactory { @SuppressWarnings("unchecked") public <T> T createReportCollection(Class<T> aClass) { requireNonNull(aClass, "class is null"); return (T) newProxyInstance(aClass.getClassLoader(), new Class[]{aClass}, new StatInvocationHandler(aClass, false, Optional.of(aClass.getSimpleName()), ImmutableMap.of())); } @Inject  ReportCollectionFactory(ReportExporter reportExporter); protected  ReportCollectionFactory(ReportExporter reportExporter, Ticker ticker); }
ReportCollectionFactory { @SuppressWarnings("unchecked") public <T> T createReportCollection(Class<T> aClass) { requireNonNull(aClass, "class is null"); return (T) newProxyInstance(aClass.getClassLoader(), new Class[]{aClass}, new StatInvocationHandler(aClass, false, Optional.of(aClass.getSimpleName()), ImmutableMap.of())); } @Inject  ReportCollectionFactory(ReportExporter reportExporter); protected  ReportCollectionFactory(ReportExporter reportExporter, Ticker ticker); @SuppressWarnings("unchecked") T createReportCollection(Class<T> aClass); @SuppressWarnings("unchecked") T createReportCollection(Class<T> aClass, boolean applicationPrefix, @Nullable String namePrefix, Map<String, String> tags); @Deprecated @SuppressWarnings("unchecked") T createReportCollection(Class<T> aClass, String name); }
ReportCollectionFactory { @SuppressWarnings("unchecked") public <T> T createReportCollection(Class<T> aClass) { requireNonNull(aClass, "class is null"); return (T) newProxyInstance(aClass.getClassLoader(), new Class[]{aClass}, new StatInvocationHandler(aClass, false, Optional.of(aClass.getSimpleName()), ImmutableMap.of())); } @Inject  ReportCollectionFactory(ReportExporter reportExporter); protected  ReportCollectionFactory(ReportExporter reportExporter, Ticker ticker); @SuppressWarnings("unchecked") T createReportCollection(Class<T> aClass); @SuppressWarnings("unchecked") T createReportCollection(Class<T> aClass, boolean applicationPrefix, @Nullable String namePrefix, Map<String, String> tags); @Deprecated @SuppressWarnings("unchecked") T createReportCollection(Class<T> aClass, String name);  }