Drop unneeded generic type specifiers
[yangtools.git] / yang / yang-parser-impl / src / test / java / org / opendaylight / yangtools / yang / parser / repo / SharedSchemaRepositoryTest.java
index 83c0a8f850c6ad2d37cf056a72635608b1e92fc3..4e280160f24fa8d2c9ed9a12b2fe4fc2b1027aa4 100644 (file)
@@ -30,13 +30,13 @@ import com.google.common.io.Files;
 import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
+import java.io.ByteArrayInputStream;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.Arrays;
 import java.util.List;
 import java.util.concurrent.ExecutionException;
-import org.apache.commons.io.IOUtils;
 import org.junit.Test;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.repo.api.MissingSchemaSourceException;
@@ -69,7 +69,7 @@ public class SharedSchemaRepositoryTest {
         assertEquals(id2, source.checkedGet().getIdentifier());
     }
 
-    private SourceIdentifier loadAndRegisterSource(final SharedSchemaRepository sharedSchemaRepository, final String resourceName) throws Exception {
+    private static SourceIdentifier loadAndRegisterSource(final SharedSchemaRepository sharedSchemaRepository, final String resourceName) throws Exception {
         final SettableSchemaProvider<ASTSchemaSource> sourceProvider = getImmediateYangSourceProviderFromResource(resourceName);
         sourceProvider.setResult();
         final SourceIdentifier idNoRevision = sourceProvider.getId();
@@ -247,7 +247,7 @@ public class SharedSchemaRepositoryTest {
             }
         };
         assertThat(Collections2.transform(listener.registeredSources, potSourceToSID),
-                both(hasItem(new SourceIdentifier("test", Optional.<String>absent())))
+                both(hasItem(new SourceIdentifier("test", Optional.absent())))
                         .and(hasItem(new SourceIdentifier("test", Optional.of("2012-12-12"))))
                         .and(hasItem(new SourceIdentifier("test", Optional.of("2013-12-12"))))
                         .and(hasItem(new SourceIdentifier("module", Optional.of("2010-12-12"))))
@@ -268,7 +268,7 @@ public class SharedSchemaRepositoryTest {
         sharedSchemaRepository.registerSchemaSource(new SchemaSourceProvider<YangTextSchemaSource>() {
             @Override
             public CheckedFuture<YangTextSchemaSource, SchemaSourceException> getSource(final SourceIdentifier sourceIdentifier) {
-                return Futures.<YangTextSchemaSource, SchemaSourceException>immediateCheckedFuture(new YangTextSchemaSource(runningId) {
+                return Futures.immediateCheckedFuture(new YangTextSchemaSource(runningId) {
                     @Override
                     protected MoreObjects.ToStringHelper addToStringAttributes(final MoreObjects.ToStringHelper toStringHelper) {
                         return toStringHelper;
@@ -276,7 +276,7 @@ public class SharedSchemaRepositoryTest {
 
                     @Override
                     public InputStream openStream() throws IOException {
-                        return IOUtils.toInputStream("running");
+                        return new ByteArrayInputStream("running".getBytes(Charsets.UTF_8));
                     }
                 });
             }
@@ -313,7 +313,7 @@ public class SharedSchemaRepositoryTest {
         fail("Creation of schema context should fail from non-regular sources");
     }
 
-    private void assertSchemaContext(final SchemaContext schemaContext, final int moduleSize) {
+    private static void assertSchemaContext(final SchemaContext schemaContext, final int moduleSize) {
         assertNotNull(schemaContext);
         assertEquals(moduleSize, schemaContext.getModules().size());
     }