@Test @SuppressWarnings("null") public void testTsMoniker() { TsMoniker input = new TsMoniker("myprovider", "id"); assertThat(checkProvider("myprovider", input)) .isSameAs(input); assertThatThrownBy(() -> checkProvider("xxx", input)) .isInstanceOf(IllegalArgumentException.class); assertThatThrownBy(() -> checkProvider(null, input)) .isInstanceOf(NullPointerException.class); assertThatThrownBy(() -> checkProvider("myprovider", (DataSource) null)) .isInstanceOf(NullPointerException.class); }
@NonNull public static DataSource checkProvider(@NonNull String providerName, @NonNull DataSource dataSource) throws IllegalArgumentException { checkProvider(providerName, dataSource.getProviderName()); return dataSource; }
DataSourcePreconditions { @NonNull public static DataSource checkProvider(@NonNull String providerName, @NonNull DataSource dataSource) throws IllegalArgumentException { checkProvider(providerName, dataSource.getProviderName()); return dataSource; } }
DataSourcePreconditions { @NonNull public static DataSource checkProvider(@NonNull String providerName, @NonNull DataSource dataSource) throws IllegalArgumentException { checkProvider(providerName, dataSource.getProviderName()); return dataSource; } private  DataSourcePreconditions(); }
DataSourcePreconditions { @NonNull public static DataSource checkProvider(@NonNull String providerName, @NonNull DataSource dataSource) throws IllegalArgumentException { checkProvider(providerName, dataSource.getProviderName()); return dataSource; } private  DataSourcePreconditions(); @NonNull static DataSource checkProvider(@NonNull String providerName, @NonNull DataSource dataSource); @NonNull static DataSet checkProvider(@NonNull String providerName, @NonNull DataSet dataSet); @NonNull static TsMoniker checkProvider(@NonNull String providerName, @NonNull TsMoniker moniker); }
DataSourcePreconditions { @NonNull public static DataSource checkProvider(@NonNull String providerName, @NonNull DataSource dataSource) throws IllegalArgumentException { checkProvider(providerName, dataSource.getProviderName()); return dataSource; } private  DataSourcePreconditions(); @NonNull static DataSource checkProvider(@NonNull String providerName, @NonNull DataSource dataSource); @NonNull static DataSet checkProvider(@NonNull String providerName, @NonNull DataSet dataSet); @NonNull static TsMoniker checkProvider(@NonNull String providerName, @NonNull TsMoniker moniker);  }