rm unrelated file add java adapter pattern