Tag Archives: Java

Amicable Numbers

Amicable Numbers Definition Two positive integer numbers (m, n) are amicable if the sum of the proper divisors of (m) is equal to (n) and the sum of the proper divisors of (n) is equal to (m). A proper divisor …

Read more »

Java Two Dimensional String Array Iterator

Problem Given the signature of the method below. It receives a two dimensional array of strings. Provide implementation that iterates through each string in each sub-array in the order they are provided but it skips null values public static Iterator …

Read more »

Java String Array of Iterators

Problem Given the Java method signature below. It receives an array of string iterators. The method should return a single string iterator that chains all iterators in order skipping null values public static Iterator iterateStrings(List<Iterator> stringIterators) Solution We wrap the …

Read more »

Java String Array Iterator Example

Problem Given the signature of the Java method below public static Iterator iterateStrings(String… strings) Provide implementation that iterates through each string in the order that they are provided but it skips null values Solution We implement the Iterable interface. We …

Read more »

Java Generic Cache Implementation

Problem Given the cache interface below //Generic Cache Interface public interface Cache<K, V> { public void put(K key, V value); public V get(K key); } We want to implement a generic cache class in order to improve compile time type …

Read more »

Java Singleton Cache Example

Problem Given the Java cache interface below, write a singleton class that implements the interface so that no warnings are generated without using @SuppressWarnings annotations //Generic Cache Interface public interface Cache<K, V> { public void put(K key, V value); public V get(K …

Read more »

Sikuli Selenium Robot Framework Tutorial

Introduction In this tutorial I will demonstrate how to integrate Sikuli (open source image based test automation tool) and Selenium (object based web automation framework) into Robot Framework (keyword and data driven test automation framework). This is not a Robot …

Read more »

Page 1 of 3123