If there is no specific function, then create a new class, copy and paste the contents of B, and then press CTRL - SHIFT - O on both files (or at least A.java) to clear the import should do this.
This is not a very common thing to ask for, and it is fairly easy to do manually.
Edit: You can also create B.java and then use Refactoring-> Move on B in A.java to move it to B.java. It seems that he did not copy the import, but when I did, while when copying and pasting manually, he automatically imported the import.
Mark peters
source share