What pattern is implemented in the chain FileInputStream → BufferedInputStream → InputStreamReader → BufferedReader?
Java
How to write a unit test for a method that calls an external system so that no real call occurs?
How do you fetch specific commits from another branch in Git?
Returns a list of book tags for authors specified by a list of identifiers.
What other second solution can be proposed for comparing two Person objects?
What needs to be done to make the Person class immutable?
What is the contract between equals() and hashCode()?
What are the main interfaces in the Java Collection API?
public class RefEx { public interface DocumentProcessor { void process(Document document); } public static class PdfProcessor implements DocumentProcessor { @Override public void process(Document document) { // Specific logic for processing PDF } } public static class DocxProcessor implements DocumentProcessor { @Override public void process(Document document) { // Specific logic for processing Word } } public static class XmlProcessor implements DocumentProcessor { @Override public void process(Document document) { // Specific logic for processing XML } } public static class DocumentService { private final Map<DocumentType, DocumentProcessor> processors = Map.of( DocumentType.PDF, new PdfProcessor(), DocumentType.DOCX, new DocxProcessor(), DocumentType.XML, new XmlProcessor() ); public void process(Document[] documents) { for (Document doc : documents) { // General document processing logic processors.get(doc.type).process(doc); } } } }
What is the Comparable interface and how is it used?
public static void filterTripleA(Collection<String> strings) { strings.removeIf(s -> s.startsWith("aaa")); }
public class RefEx { public static class PdfProcessor implements DocumentProcessor { } public static class DocxProcessor implements DocumentProcessor { @Override public void process(Document document) { // Specific logic for processing Word } } public static class XmlProcessor implements DocumentProcessor { @Override public void process(Document document) { // Specific logic for processing XML } } public static class DocumentService { private final Map<DocumentType, DocumentProcessor> processors = Map.of( DocumentType.PDF, new PdfProcessor(), DocumentType.DOCX, new DocxProcessor(), DocumentType.XML, new XmlProcessor() ); public void process(Document[] documents) { for (Document doc : documents) { DocumentProcessor processor = processors.get(doc.type); if (processor == null) { break; } // General document processing logic processor.process(doc); } } } }
Where can a NullPointerException occur in the getTagsOfAuthorsBooks method?
What is an annotation in Java?
Given the following Java class class Person { String firstName; String lastName; Integer age; } Implement a standard method that compares two Person objects.
Tell us about yourself and your work experience (not repeating your resume): interesting tasks, business context, what you did personally.
What protocols, frameworks, and libraries exist in Java for working with DBMS?
What is GOF (Gang of Four) and which patterns from this book are implemented in the standard JDK?