diff --git a/drools-compiler/src/main/java/org/drools/compiler/builder/impl/CompositeKnowledgeBuilderImpl.java b/drools-compiler/src/main/java/org/drools/compiler/builder/impl/CompositeKnowledgeBuilderImpl.java
index edee5aca18..42d70b1406 100644
--- a/drools-compiler/src/main/java/org/drools/compiler/builder/impl/CompositeKnowledgeBuilderImpl.java
+++ b/drools-compiler/src/main/java/org/drools/compiler/builder/impl/CompositeKnowledgeBuilderImpl.java
@@ -125,7 +125,6 @@ public class CompositeKnowledgeBuilderImpl implements CompositeKnowledgeBuilder
     private void buildResources() {
         buildResourceType(ResourceBuilder.DSL_RESOURCE_BUILDER, ResourceType.DSL);
         buildResourceType(ResourceBuilder.DRF_RESOURCE_BUILDER, ResourceType.DRF);
-        buildResourceType(ResourceBuilder.PKG_RESOURCE_BUILDER, ResourceType.PKG);
         buildResourceType(ResourceBuilder.CHANGE_SET_RESOURCE_BUILDER, ResourceType.CHANGE_SET);
         buildResourceType(ResourceBuilder.XSD_RESOURCE_BUILDER, ResourceType.XSD);
         buildResourceType(ResourceBuilder.SCD_RESOURCE_BUILDER, ResourceType.SCARD);
@@ -301,8 +300,6 @@ public class CompositeKnowledgeBuilderImpl implements CompositeKnowledgeBuilder

         ResourceBuilder CHANGE_SET_RESOURCE_BUILDER = ( kBuilder, resourceDescr ) -> kBuilder.addPackageFromChangeSet( resourceDescr.resource);

-        ResourceBuilder PKG_RESOURCE_BUILDER = ( kBuilder, resourceDescr ) -> kBuilder.addPackageFromInputStream(resourceDescr.resource );
-
         ResourceBuilder BPMN2_RESOURCE_BUILDER = ( kBuilder, resourceDescr ) -> {
             kBuilder.addKnowledgeResource( resourceDescr.resource, ResourceType.BPMN2, resourceDescr.configuration );
         };
diff --git a/drools-compiler/src/main/java/org/drools/compiler/builder/impl/KnowledgeBuilderImpl.java b/drools-compiler/src/main/java/org/drools/compiler/builder/impl/KnowledgeBuilderImpl.java
index 55156295ca..171a766586 100644
--- a/drools-compiler/src/main/java/org/drools/compiler/builder/impl/KnowledgeBuilderImpl.java
+++ b/drools-compiler/src/main/java/org/drools/compiler/builder/impl/KnowledgeBuilderImpl.java
@@ -18,7 +18,6 @@ package org.drools.compiler.builder.impl;
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
-import java.io.InputStream;
 import java.io.Reader;
 import java.io.StringReader;
 import java.lang.reflect.Array;
@@ -127,7 +126,6 @@ import org.drools.core.rule.JavaDialectRuntimeData;
 import org.drools.core.rule.Pattern;
 import org.drools.core.rule.TypeDeclaration;
 import org.drools.core.rule.WindowDeclaration;
-import org.drools.core.util.DroolsStreamUtils;
 import org.drools.core.util.IoUtils;
 import org.drools.core.util.StringUtils;
 import org.drools.core.xml.XmlChangeSetReader;
@@ -743,8 +741,6 @@ public class KnowledgeBuilderImpl implements KnowledgeBuilder,
                 addPackageFromXml(resource);
             } else if (ResourceType.DTABLE.equals(type)) {
                 addPackageFromDecisionTable(resource, configuration);
-            } else if (ResourceType.PKG.equals(type)) {
-                addPackageFromInputStream(resource);
             } else if (ResourceType.CHANGE_SET.equals(type)) {
                 addPackageFromChangeSet(resource);
             } else if (ResourceType.XSD.equals(type)) {
@@ -843,70 +839,6 @@ public class KnowledgeBuilderImpl implements KnowledgeBuilder,
         }
     }

-    void addPackageFromInputStream(final Resource resource) throws IOException,
-            ClassNotFoundException {
-        InputStream is = resource.getInputStream();
-        Object object = DroolsStreamUtils.streamIn(is, this.configuration.getClassLoader());
-        is.close();
-        if (object instanceof Collection) {
-            // KnowledgeBuilder API
-            @SuppressWarnings("unchecked")
-            Collection<KiePackage> pkgs = (Collection<KiePackage>) object;
-            for (KiePackage kpkg : pkgs) {
-                overrideReSource((KnowledgePackageImpl) kpkg, resource);
-                addPackage((KnowledgePackageImpl) kpkg);
-            }
-        } else if (object instanceof KnowledgePackageImpl) {
-            // KnowledgeBuilder API
-            KnowledgePackageImpl kpkg = (KnowledgePackageImpl) object;
-            overrideReSource(kpkg, resource);
-            addPackage(kpkg);
-        } else {
-            results.add(new DroolsError(resource) {
-
-                @Override
-                public String getMessage() {
-                    return "Unknown binary format trying to load resource " + resource.toString();
-                }
-
-                @Override
-                public int[] getLines() {
-                    return new int[0];
-                }
-            });
-        }
-    }
-
-    private void overrideReSource(InternalKnowledgePackage pkg,
-                                  Resource res) {
-        for (org.kie.api.definition.rule.Rule r : pkg.getRules()) {
-            if (isSwappable(((RuleImpl) r).getResource(), res)) {
-                ((RuleImpl) r).setResource(res);
-            }
-        }
-        for (TypeDeclaration d : pkg.getTypeDeclarations().values()) {
-            if (isSwappable(d.getResource(), res)) {
-                d.setResource(res);
-            }
-        }
-        for (Function f : pkg.getFunctions().values()) {
-            if (isSwappable(f.getResource(), res)) {
-                f.setResource(res);
-            }
-        }
-        for (org.kie.api.definition.process.Process p : pkg.getRuleFlows().values()) {
-            if (isSwappable(p.getResource(), res)) {
-                p.setResource(res);
-            }
-        }
-    }
-
-    private boolean isSwappable(Resource original,
-                                Resource source) {
-        return original == null
-                || (original instanceof ReaderResource && ((ReaderResource) original).getReader() == null);
-    }
-
     /**
      * This adds a package from a Descr/AST This will also trigger a compile, if
      * there are any generated classes to compile of course.
diff --git a/drools-compiler/src/test/java/org/drools/compiler/integrationtests/SerializedPackageMergeTest.java b/drools-compiler/src/test/java/org/drools/compiler/integrationtests/SerializedPackageMergeTest.java
index c57b45de95..eb20451839 100644
--- a/drools-compiler/src/test/java/org/drools/compiler/integrationtests/SerializedPackageMergeTest.java
+++ b/drools-compiler/src/test/java/org/drools/compiler/integrationtests/SerializedPackageMergeTest.java
@@ -188,81 +188,4 @@ public class SerializedPackageMergeTest {
         }
     }

-    @Test
-    public void testBuildAndSerializePackagesWithGetterInLHS() throws Exception {
-        // DROOLS-2495
-        String drl =   "package com.sample\n" +
-                        "import org.drools.compiler.Person\n" +
-                        "import org.drools.compiler.Cheese\n" +
-                        "rule R1\n" +
-                        "when\n" +
-                        "  $p : Person()\n" +
-                        "  $c : Cheese(type == $p.getName())\n" +
-                        "then\n" +
-                        "end\n";
-
-        KnowledgeBuilder builder1 = KnowledgeBuilderFactory.newKnowledgeBuilder();
-        builder1.add(ResourceFactory.newByteArrayResource(drl.getBytes()), ResourceType.DRL);
-        Collection<KiePackage> knowledgePackages = builder1.getKnowledgePackages();
-
-        byte[] pkgBin = null;
-        try (ByteArrayOutputStream byteOutStream = new ByteArrayOutputStream();
-                DroolsObjectOutputStream out = new DroolsObjectOutputStream(byteOutStream);) {
-            out.writeObject(knowledgePackages);
-            out.flush();
-            pkgBin = byteOutStream.toByteArray();
-        }
-
-        KnowledgeBuilder builder2 = KnowledgeBuilderFactory.newKnowledgeBuilder();
-        builder2.add(ResourceFactory.newByteArrayResource(pkgBin), ResourceType.PKG);
-        KieBase kbase = builder2.newKieBase();
-
-        KieSession ksession = kbase.newKieSession();
-        try {
-            ksession.insert(new org.drools.compiler.Person("aaa"));
-            ksession.insert(new org.drools.compiler.Cheese("aaa"));
-            ksession.fireAllRules();
-        } finally {
-            ksession.dispose();
-        }
-    }
-
-    @Test
-    public void testBuildAndSerializePackagesWithGlobalMethodInLHS() throws Exception {
-        // DROOLS-2517
-        String drl =   "package com.sample\n" +
-                "import org.drools.compiler.Person\n" +
-                "global org.drools.compiler.MyUtil myUtil\n" +
-                "rule R1\n" +
-                "when\n" +
-                "  Person(myUtil.transform(name) == \"John-san\")\n" + // call global's method
-                "then\n" +
-                "end\n";
-
-        KnowledgeBuilder builder1 = KnowledgeBuilderFactory.newKnowledgeBuilder();
-        builder1.add(ResourceFactory.newByteArrayResource(drl.getBytes()), ResourceType.DRL);
-        Collection<KiePackage> knowledgePackages = builder1.getKnowledgePackages();
-
-        byte[] pkgBin = null;
-        try (ByteArrayOutputStream byteOutStream = new ByteArrayOutputStream();
-                DroolsObjectOutputStream out = new DroolsObjectOutputStream(byteOutStream);) {
-            out.writeObject(knowledgePackages);
-            out.flush();
-            pkgBin = byteOutStream.toByteArray();
-        }
-
-        KnowledgeBuilder builder2 = KnowledgeBuilderFactory.newKnowledgeBuilder();
-        builder2.add(ResourceFactory.newByteArrayResource(pkgBin), ResourceType.PKG);
-        KieBase kbase = builder2.newKieBase();
-
-        KieSession ksession = kbase.newKieSession();
-        try {
-            ksession.setGlobal("myUtil", new org.drools.compiler.MyUtil());
-            ksession.insert(new org.drools.compiler.Person("John"));
-            int fired = ksession.fireAllRules();
-            assertEquals(1, fired);
-        } finally {
-            ksession.dispose();
-        }
-    }
 }
diff --git a/drools-core/src/main/java/org/drools/core/util/DroolsStreamUtils.java b/drools-core/src/test/java/org/drools/core/util/DroolsStreamUtils.java
similarity index 100%
rename from drools-core/src/main/java/org/drools/core/util/DroolsStreamUtils.java
rename to drools-core/src/test/java/org/drools/core/util/DroolsStreamUtils.java
