Skip to content

Instantly share code, notes, and snippets.

public class Robot {
public static class Legs implements Runnable {
String leg;
public Legs(String leg) {
this.leg = leg;
}
public void doStep() {
@itallix
itallix / gist:6069702
Created July 24, 2013 11:12
Interview Task from Natalia
TEST:
We have a string that contains a list of key-value pairs in the following format:
;key1@value2;key2@value;key2@value2;....
Your class should have a method to process this string. Strings that do not satisfy the format
should be discharged by throwing an exception. The compliant string should be processed to
extract all keys and values and store them locally so they become searchable
The other 2 methods should return the related value for the passed key and the related key for
the passed value.
import java.util.HashMap;
import java.util.Map;
/**
* Created with IntelliJ IDEA.
* User: vkarnyushin
* Date: 24.07.13
* Time: 17:34
* To change this template use File | Settings | File Templates.
*/
import java.util.HashMap;
import java.util.Map;
public class Main {
private static class Test {
Map<String, String> valuesMap = new HashMap<String, String>();
public void process(String initialString) throws Exception {
import java.util.HashMap;
import java.util.IllegalFormatException;
import java.util.Map;
public class Main {
public static void main(String[] args) throws Exception
{
}
/**
* Moderna
*/
package com.modernatx.lp.controller;
import com.modernatx.framework.commons.entity.Application;
import com.modernatx.framework.commons.util.Utils;
import com.modernatx.lp.controller.model.LoadWorkListsByDateRangeRequest;
import com.modernatx.lp.controller.model.UpdateOrderNotesRequest;
/**
* Moderna
*/
package com.modernatx.lp.controller;
import com.modernatx.framework.commons.entity.search.SearchSortOrder;
import com.modernatx.framework.commons.ordering.entity.BaseOrderItemRNA;
import com.modernatx.lp.controller.model.SearchFieldValue;
import com.modernatx.lp.controller.model.SearchRequest;
package com.modernatx.lp.controller;
import com.modernatx.framework.commons.entity.WorkListOrderNote;
import com.modernatx.framework.commons.manager.WorkListManager;
import com.modernatx.framework.commons.util.Utils;
import com.modernatx.lp.controller.model.UpdateOrderNotesRequest;
import com.modernatx.lp.controller.model.WorkListOrderVO;
import com.modernatx.lp.controller.model.WorkListVO;
import org.codehaus.jackson.JsonNode;
import org.hamcrest.Matcher;
public class Main {
private final static class Task implements Runnable {
private Object wait;
//private Object notify;
private int count;
private int number;
private boolean last = false;
@itallix
itallix / findElementByText.js
Created October 22, 2019 09:36
[find element by text] #enzyme #unit
const action2Button = wrapper.find('button[children="Action 2"]');
expect(action2Button).toHaveLength(1);
action2Button.simulate('click');
const button = wrapper.findWhere(node => {
return (
node.children().length === 0 &&
node.name() &&
node.text() === "Action 2"
);